Re: [PATCH 3/3] mm: idle memory tracking
On Thu, Mar 19, 2015 at 01:41:03PM +0300, Vladimir Davydov wrote: > > > > Vladimir, might we need get_online_mems/put_online_mems here, > > or if node gets offline this wont be a problem? (Asking > > because i don't know). > > I only need to dereference page structs corresponding to the node here, > and page structs are not freed when the node gets offline AFAICS, so I > guess it must be safe. OK, thanks for info! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/3] mm: idle memory tracking
On Thu, Mar 19, 2015 at 01:12:05PM +0300, Cyrill Gorcunov wrote: > On Wed, Mar 18, 2015 at 11:44:36PM +0300, Vladimir Davydov wrote: > > +static void set_mem_idle(void) > > +{ > > + int nid; > > + > > + for_each_online_node(nid) > > + set_mem_idle_node(nid); > > +} > > Vladimir, might we need get_online_mems/put_online_mems here, > or if node gets offline this wont be a problem? (Asking > because i don't know). I only need to dereference page structs corresponding to the node here, and page structs are not freed when the node gets offline AFAICS, so I guess it must be safe. Thanks, Vladimir -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/3] mm: idle memory tracking
On Wed, Mar 18, 2015 at 11:44:36PM +0300, Vladimir Davydov wrote: > Knowing the portion of memory that is not used by a certain application > or memory cgroup (idle memory) can be useful for partitioning the system > efficiently. Currently, the only means to estimate the amount of idle > memory provided by the kernel is /proc/PID/clear_refs. However, it has > two serious shortcomings: > > - it does not count unmapped file pages > - it affects the reclaimer logic > > This patch attempts to provide the userspace with the means to track > idle memory without the above mentioned limitations. ... > +static void set_mem_idle(void) > +{ > + int nid; > + > + for_each_online_node(nid) > + set_mem_idle_node(nid); > +} Vladimir, might we need get_online_mems/put_online_mems here, or if node gets offline this wont be a problem? (Asking because i don't know). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/3] mm: idle memory tracking
On Thu, Mar 19, 2015 at 01:12:05PM +0300, Cyrill Gorcunov wrote: On Wed, Mar 18, 2015 at 11:44:36PM +0300, Vladimir Davydov wrote: +static void set_mem_idle(void) +{ + int nid; + + for_each_online_node(nid) + set_mem_idle_node(nid); +} Vladimir, might we need get_online_mems/put_online_mems here, or if node gets offline this wont be a problem? (Asking because i don't know). I only need to dereference page structs corresponding to the node here, and page structs are not freed when the node gets offline AFAICS, so I guess it must be safe. Thanks, Vladimir -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/3] mm: idle memory tracking
On Thu, Mar 19, 2015 at 01:41:03PM +0300, Vladimir Davydov wrote: Vladimir, might we need get_online_mems/put_online_mems here, or if node gets offline this wont be a problem? (Asking because i don't know). I only need to dereference page structs corresponding to the node here, and page structs are not freed when the node gets offline AFAICS, so I guess it must be safe. OK, thanks for info! -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/3] mm: idle memory tracking
On Wed, Mar 18, 2015 at 11:44:36PM +0300, Vladimir Davydov wrote: Knowing the portion of memory that is not used by a certain application or memory cgroup (idle memory) can be useful for partitioning the system efficiently. Currently, the only means to estimate the amount of idle memory provided by the kernel is /proc/PID/clear_refs. However, it has two serious shortcomings: - it does not count unmapped file pages - it affects the reclaimer logic This patch attempts to provide the userspace with the means to track idle memory without the above mentioned limitations. ... +static void set_mem_idle(void) +{ + int nid; + + for_each_online_node(nid) + set_mem_idle_node(nid); +} Vladimir, might we need get_online_mems/put_online_mems here, or if node gets offline this wont be a problem? (Asking because i don't know). -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/