From: Mel Gorman <mgorman@techsingularity.net>
To: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>,
Hillf Danton <hillf.zj@alibaba-inc.com>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Petr Mladek <pmladek@suse.cz>
Subject: Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context
Date: Mon, 23 Jan 2017 20:04:12 +0000 [thread overview]
Message-ID: <20170123200412.mkesardc4mckk6df@techsingularity.net> (raw)
In-Reply-To: <20170123170329.GA7820@htj.duckdns.org>
On Mon, Jan 23, 2017 at 12:03:29PM -0500, Tejun Heo wrote:
> Hello,
>
> On Fri, Jan 20, 2017 at 03:26:06PM +0000, Mel Gorman wrote:
> > > This translates to queue_work_on(), which has the comment of "We queue
> > > the work to a specific CPU, the caller must ensure it can't go away.",
> > > so is this safe? lru_add_drain_all() uses get_online_cpus() around this.
> > >
> >
> > get_online_cpus() would be required.
>
> This part of workqueue usage has always been a bit clunky and I should
> imrpove it but you don't necessarily have to pin the cpus from
> queueing to execution. You can queue without checking whether the CPU
> is online and instead synchronize the actual work item execution
> against cpu offline callback so that if the work item gets executed
> after offline callback is finished, it becomes a noop.
>
What is the actual mechanism that does that? It's not something that
schedule_on_each_cpu does and one would expect that the core workqueue
implementation would get this sort of detail correct. Or is this a proposal
on how it should be done?
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@techsingularity.net>
To: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>,
Hillf Danton <hillf.zj@alibaba-inc.com>,
Jesper Dangaard Brouer <brouer@redhat.com>,
Petr Mladek <pmladek@suse.cz>
Subject: Re: [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context
Date: Mon, 23 Jan 2017 20:04:12 +0000 [thread overview]
Message-ID: <20170123200412.mkesardc4mckk6df@techsingularity.net> (raw)
In-Reply-To: <20170123170329.GA7820@htj.duckdns.org>
On Mon, Jan 23, 2017 at 12:03:29PM -0500, Tejun Heo wrote:
> Hello,
>
> On Fri, Jan 20, 2017 at 03:26:06PM +0000, Mel Gorman wrote:
> > > This translates to queue_work_on(), which has the comment of "We queue
> > > the work to a specific CPU, the caller must ensure it can't go away.",
> > > so is this safe? lru_add_drain_all() uses get_online_cpus() around this.
> > >
> >
> > get_online_cpus() would be required.
>
> This part of workqueue usage has always been a bit clunky and I should
> imrpove it but you don't necessarily have to pin the cpus from
> queueing to execution. You can queue without checking whether the CPU
> is online and instead synchronize the actual work item execution
> against cpu offline callback so that if the work item gets executed
> after offline callback is finished, it becomes a noop.
>
What is the actual mechanism that does that? It's not something that
schedule_on_each_cpu does and one would expect that the core workqueue
implementation would get this sort of detail correct. Or is this a proposal
on how it should be done?
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2017-01-23 20:04 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 9:29 [PATCH 0/4] Use per-cpu allocator for !irq requests and prepare for a bulk allocator v4 Mel Gorman
2017-01-17 9:29 ` Mel Gorman
2017-01-17 9:29 ` [PATCH 1/4] mm, page_alloc: Split buffered_rmqueue Mel Gorman
2017-01-17 9:29 ` Mel Gorman
2017-01-17 18:07 ` Jesper Dangaard Brouer
2017-01-17 18:07 ` Jesper Dangaard Brouer
2017-01-17 18:17 ` Vlastimil Babka
2017-01-17 20:20 ` Mel Gorman
2017-01-17 20:20 ` Mel Gorman
2017-01-17 21:07 ` Mel Gorman
2017-01-17 21:07 ` Mel Gorman
2017-01-17 21:24 ` Vlastimil Babka
2017-01-17 21:24 ` Vlastimil Babka
2017-01-17 9:29 ` [PATCH 2/4] mm, page_alloc: Split alloc_pages_nodemask Mel Gorman
2017-01-17 9:29 ` Mel Gorman
2017-01-17 9:29 ` [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context Mel Gorman
2017-01-17 9:29 ` Mel Gorman
2017-01-20 14:26 ` Vlastimil Babka
2017-01-20 14:26 ` Vlastimil Babka
2017-01-20 15:26 ` Mel Gorman
2017-01-20 15:26 ` Mel Gorman
2017-01-23 16:29 ` Petr Mladek
2017-01-23 16:29 ` Petr Mladek
2017-01-23 16:50 ` Mel Gorman
2017-01-23 16:50 ` Mel Gorman
2017-01-23 17:03 ` Tejun Heo
2017-01-23 17:03 ` Tejun Heo
2017-01-23 20:04 ` Mel Gorman [this message]
2017-01-23 20:04 ` Mel Gorman
2017-01-23 20:55 ` Tejun Heo
2017-01-23 20:55 ` Tejun Heo
2017-01-23 23:04 ` Mel Gorman
2017-01-23 23:04 ` Mel Gorman
2017-01-24 16:07 ` Tejun Heo
2017-01-24 16:07 ` Tejun Heo
2017-01-24 23:54 ` Mel Gorman
2017-01-24 23:54 ` Mel Gorman
2017-01-25 2:02 ` Tejun Heo
2017-01-25 2:02 ` Tejun Heo
2017-01-25 8:30 ` Mel Gorman
2017-01-25 8:30 ` Mel Gorman
2017-01-24 11:08 ` Vlastimil Babka
2017-01-24 11:08 ` Vlastimil Babka
2017-01-17 9:29 ` [PATCH 4/4] mm, page_alloc: Only use per-cpu allocator for irq-safe requests Mel Gorman
2017-01-17 9:29 ` Mel Gorman
2017-01-20 15:02 ` Vlastimil Babka
2017-01-20 15:02 ` Vlastimil Babka
2017-01-23 11:17 ` Mel Gorman
2017-01-23 11:17 ` Mel Gorman
-- strict thread matches above, loose matches on Subject: below --
2017-01-23 15:39 [PATCH 0/4] Use per-cpu allocator for !irq requests and prepare for a bulk allocator v5 Mel Gorman
2017-01-23 15:39 ` [PATCH 3/4] mm, page_alloc: Drain per-cpu pages from workqueue context Mel Gorman
2017-01-23 15:39 ` Mel Gorman
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=20170123200412.mkesardc4mckk6df@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=akpm@linux-foundation.org \
--cc=brouer@redhat.com \
--cc=hillf.zj@alibaba-inc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pmladek@suse.cz \
--cc=tj@kernel.org \
--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: link
Be 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.