From: Mel Gorman <mgorman@suse.de> To: Michal Hocko <mhocko@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org>, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, Vlastimil Babka <vbabka@suse.cz>, linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>, Michal Hocko <mhocko@suse.com> Subject: Re: [PATCH] mm: move pcp and lru-pcp drainging into single wq Date: Thu, 9 Mar 2017 14:26:02 +0000 [thread overview] Message-ID: <20170309142602.nhuawsps3mdxqxjv@suse.de> (raw) In-Reply-To: <20170307131751.24936-1-mhocko@kernel.org> On Tue, Mar 07, 2017 at 02:17:51PM +0100, Michal Hocko wrote: > From: Michal Hocko <mhocko@suse.com> > > We currently have 2 specific WQ_RECLAIM workqueues in the mm code. > vmstat_wq for updating pcp stats and lru_add_drain_wq dedicated to drain > per cpu lru caches. This seems more than necessary because both can run > on a single WQ. Both do not block on locks requiring a memory allocation > nor perform any allocations themselves. We will save one rescuer thread > this way. > > On the other hand drain_all_pages() queues work on the system wq which > doesn't have rescuer and so this depend on memory allocation (when all > workers are stuck allocating and new ones cannot be created). This is > not critical as there should be somebody invoking the OOM killer (e.g. > the forking worker) and get the situation unstuck and eventually > performs the draining. Quite annoying though. This worker should be > using WQ_RECLAIM as well. We can reuse the same one as for lru draining > and vmstat. > > Changes since v1 > - rename vmstat_wq to mm_percpu_wq - per Mel > - make sure we are not trying to enqueue anything while the WQ hasn't > been intialized yet. This shouldn't happen because the initialization > is done from an init code but some init section might be triggering > those paths indirectly so just warn and skip the draining in that case > per Vlastimil > - do not propagate error from setup_vmstat to keep the previous behavior > per Mel > > Suggested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > Signed-off-by: Michal Hocko <mhocko@suse.com> Acked-by: Mel Gorman <mgorman@suse.de> > +struct workqueue_struct *mm_percpu_wq; > + > static int __init setup_vmstat(void) > { > -#ifdef CONFIG_SMP > - int ret; > + int ret __maybe_unused; > > + mm_percpu_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); > + > +#ifdef CONFIG_SMP > ret = cpuhp_setup_state_nocalls(CPUHP_MM_VMSTAT_DEAD, "mm/vmstat:dead", > NULL, vmstat_cpu_dead); > if (ret < 0) Should the workqueue also have been renamed to mm_percpu_wq? -- Mel Gorman SUSE Labs
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@suse.de> To: Michal Hocko <mhocko@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org>, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, Vlastimil Babka <vbabka@suse.cz>, linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>, Michal Hocko <mhocko@suse.com> Subject: Re: [PATCH] mm: move pcp and lru-pcp drainging into single wq Date: Thu, 9 Mar 2017 14:26:02 +0000 [thread overview] Message-ID: <20170309142602.nhuawsps3mdxqxjv@suse.de> (raw) In-Reply-To: <20170307131751.24936-1-mhocko@kernel.org> On Tue, Mar 07, 2017 at 02:17:51PM +0100, Michal Hocko wrote: > From: Michal Hocko <mhocko@suse.com> > > We currently have 2 specific WQ_RECLAIM workqueues in the mm code. > vmstat_wq for updating pcp stats and lru_add_drain_wq dedicated to drain > per cpu lru caches. This seems more than necessary because both can run > on a single WQ. Both do not block on locks requiring a memory allocation > nor perform any allocations themselves. We will save one rescuer thread > this way. > > On the other hand drain_all_pages() queues work on the system wq which > doesn't have rescuer and so this depend on memory allocation (when all > workers are stuck allocating and new ones cannot be created). This is > not critical as there should be somebody invoking the OOM killer (e.g. > the forking worker) and get the situation unstuck and eventually > performs the draining. Quite annoying though. This worker should be > using WQ_RECLAIM as well. We can reuse the same one as for lru draining > and vmstat. > > Changes since v1 > - rename vmstat_wq to mm_percpu_wq - per Mel > - make sure we are not trying to enqueue anything while the WQ hasn't > been intialized yet. This shouldn't happen because the initialization > is done from an init code but some init section might be triggering > those paths indirectly so just warn and skip the draining in that case > per Vlastimil > - do not propagate error from setup_vmstat to keep the previous behavior > per Mel > > Suggested-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> > Signed-off-by: Michal Hocko <mhocko@suse.com> Acked-by: Mel Gorman <mgorman@suse.de> > +struct workqueue_struct *mm_percpu_wq; > + > static int __init setup_vmstat(void) > { > -#ifdef CONFIG_SMP > - int ret; > + int ret __maybe_unused; > > + mm_percpu_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); > + > +#ifdef CONFIG_SMP > ret = cpuhp_setup_state_nocalls(CPUHP_MM_VMSTAT_DEAD, "mm/vmstat:dead", > NULL, vmstat_cpu_dead); > if (ret < 0) Should the workqueue also have been renamed to mm_percpu_wq? -- Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-03-09 14:44 UTC|newest] Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-03-07 13:17 [PATCH] mm: move pcp and lru-pcp drainging into single wq Michal Hocko 2017-03-07 13:17 ` Michal Hocko 2017-03-07 13:34 ` Vlastimil Babka 2017-03-07 13:34 ` Vlastimil Babka 2017-03-07 13:50 ` Tetsuo Handa 2017-03-07 13:50 ` Tetsuo Handa 2017-03-07 14:23 ` Michal Hocko 2017-03-07 14:23 ` Michal Hocko 2017-03-08 11:50 ` Tetsuo Handa 2017-03-08 11:50 ` Tetsuo Handa 2017-03-08 13:01 ` Michal Hocko 2017-03-08 13:01 ` Michal Hocko 2017-03-09 14:26 ` Mel Gorman [this message] 2017-03-09 14:26 ` Mel Gorman 2017-03-09 14:44 ` Michal Hocko 2017-03-09 14:44 ` Michal Hocko 2017-03-10 23:31 ` Yang Li 2017-03-10 23:31 ` Yang Li 2017-03-13 9:58 ` Michal Hocko 2017-03-13 9:58 ` Michal Hocko 2017-03-14 23:07 ` Yang Li 2017-03-14 23:07 ` Yang Li 2017-03-14 23:07 ` Yang Li 2017-03-15 7:39 ` Michal Hocko 2017-03-15 7:39 ` Michal Hocko 2017-03-15 7:39 ` Michal Hocko 2017-03-15 16:31 ` Yang Li 2017-03-15 16:31 ` Yang Li 2017-03-15 16:31 ` Yang Li
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170309142602.nhuawsps3mdxqxjv@suse.de \ --to=mgorman@suse.de \ --cc=akpm@linux-foundation.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mhocko@kernel.org \ --cc=mhocko@suse.com \ --cc=penguin-kernel@I-love.SAKURA.ne.jp \ --cc=vbabka@suse.cz \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.