Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Vaidyanathan Srinivasan
Balbir Singh wrote: > Vaidyanathan Srinivasan wrote: >> Balbir Singh wrote: >>> Paul Menage wrote: On 2/19/07, Balbir Singh <[EMAIL PROTECTED]> wrote: >> More worrisome is the potential for use-after-free. What prevents the >> pointer at mm->container from referring to freed memory

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Vaidyanathan Srinivasan wrote: Balbir Singh wrote: Paul Menage wrote: On 2/19/07, Balbir Singh <[EMAIL PROTECTED]> wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm->container from referring to freed memory after we're dropped the lock? The

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Vaidyanathan Srinivasan
Balbir Singh wrote: > Paul Menage wrote: >> On 2/19/07, Balbir Singh <[EMAIL PROTECTED]> wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm->container from referring to freed memory after we're dropped the lock? >>> The container

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Paul Menage wrote: On 2/19/07, Balbir Singh <[EMAIL PROTECTED]> wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm->container from referring to freed memory after we're dropped the lock? The container cannot be freed unless all tasks holding references

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Paul Menage
On 2/19/07, Balbir Singh <[EMAIL PROTECTED]> wrote: > > More worrisome is the potential for use-after-free. What prevents the > pointer at mm->container from referring to freed memory after we're dropped > the lock? > The container cannot be freed unless all tasks holding references to it are

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Andrew Morton wrote: On Mon, 19 Feb 2007 16:39:33 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: Andrew Morton wrote: On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: +void memctlr_mm_free(struct mm_struct *mm) +{ + kfree(mm->counter); +} + +static inline void

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Andrew Morton
On Mon, 19 Feb 2007 16:39:33 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: > Andrew Morton wrote: > > On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: > > > +void memctlr_mm_free(struct mm_struct *mm) > +{ > +kfree(mm->counter); > +} > +

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Andrew Morton
On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: > >> +void memctlr_mm_free(struct mm_struct *mm) > >> +{ > >> + kfree(mm->counter); > >> +} > >> + > >> +static inline void memctlr_mm_assign_container_direct(struct mm_struct > >> *mm, > >> +

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Andrew Morton wrote: On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: +void memctlr_mm_free(struct mm_struct *mm) +{ + kfree(mm->counter); +} + +static inline void memctlr_mm_assign_container_direct(struct mm_struct *mm, +

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Andrew Morton wrote: On Mon, 19 Feb 2007 12:20:34 +0530 Balbir Singh <[EMAIL PROTECTED]> wrote: This patch adds the basic accounting hooks to account for pages allocated into the RSS of a process. Accounting is maintained at two levels, in the mm_struct of each task and in the memory

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Andrew Morton wrote: On Mon, 19 Feb 2007 12:20:34 +0530 Balbir Singh [EMAIL PROTECTED] wrote: This patch adds the basic accounting hooks to account for pages allocated into the RSS of a process. Accounting is maintained at two levels, in the mm_struct of each task and in the memory controller

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Andrew Morton wrote: On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh [EMAIL PROTECTED] wrote: +void memctlr_mm_free(struct mm_struct *mm) +{ + kfree(mm-counter); +} + +static inline void memctlr_mm_assign_container_direct(struct mm_struct *mm, +

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Andrew Morton
On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh [EMAIL PROTECTED] wrote: +void memctlr_mm_free(struct mm_struct *mm) +{ + kfree(mm-counter); +} + +static inline void memctlr_mm_assign_container_direct(struct mm_struct *mm, +

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Andrew Morton
On Mon, 19 Feb 2007 16:39:33 +0530 Balbir Singh [EMAIL PROTECTED] wrote: Andrew Morton wrote: On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh [EMAIL PROTECTED] wrote: +void memctlr_mm_free(struct mm_struct *mm) +{ +kfree(mm-counter); +} + +static inline void

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Andrew Morton wrote: On Mon, 19 Feb 2007 16:39:33 +0530 Balbir Singh [EMAIL PROTECTED] wrote: Andrew Morton wrote: On Mon, 19 Feb 2007 16:07:44 +0530 Balbir Singh [EMAIL PROTECTED] wrote: +void memctlr_mm_free(struct mm_struct *mm) +{ + kfree(mm-counter); +} + +static inline void

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Paul Menage
On 2/19/07, Balbir Singh [EMAIL PROTECTED] wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm-container from referring to freed memory after we're dropped the lock? The container cannot be freed unless all tasks holding references to it are gone,

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Paul Menage wrote: On 2/19/07, Balbir Singh [EMAIL PROTECTED] wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm-container from referring to freed memory after we're dropped the lock? The container cannot be freed unless all tasks holding references to

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Vaidyanathan Srinivasan
Balbir Singh wrote: Paul Menage wrote: On 2/19/07, Balbir Singh [EMAIL PROTECTED] wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm-container from referring to freed memory after we're dropped the lock? The container cannot be freed unless all

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Balbir Singh
Vaidyanathan Srinivasan wrote: Balbir Singh wrote: Paul Menage wrote: On 2/19/07, Balbir Singh [EMAIL PROTECTED] wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm-container from referring to freed memory after we're dropped the lock? The container

Re: [ckrm-tech] [RFC][PATCH][2/4] Add RSS accounting and control

2007-02-19 Thread Vaidyanathan Srinivasan
Balbir Singh wrote: Vaidyanathan Srinivasan wrote: Balbir Singh wrote: Paul Menage wrote: On 2/19/07, Balbir Singh [EMAIL PROTECTED] wrote: More worrisome is the potential for use-after-free. What prevents the pointer at mm-container from referring to freed memory after we're dropped