From: Mel Gorman <mgorman@techsingularity.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>, Vlastimil Babka <vbabka@suse.cz>,
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>
Subject: Re: [PATCH] mm, page_alloc: Use static global work_struct for draining per-cpu pages
Date: Thu, 26 Jan 2017 10:47:32 +0000 [thread overview]
Message-ID: <20170126104732.meri27v5lf3or22j@techsingularity.net> (raw)
In-Reply-To: <20170125160802.67172878e6692e45fa035f37@linux-foundation.org>
On Wed, Jan 25, 2017 at 04:08:02PM -0800, Andrew Morton wrote:
> > + for_each_cpu(cpu, &cpus_with_pcps) {
> > + struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu);
> > + INIT_WORK(work, drain_local_pages_wq);
>
> It's strange to repeatedly run INIT_WORK() in this fashion.
> Overwriting an atomic_t which should already be zero, initializing a
> list_head which should already be in the initialized state...
>
> Can we instead do this a single time in init code?
>
INIT_WORK does different things depending on whether LOCKDEP is enabled or
not and also whether object debugging is enabled. I'd worry that it's not
functionally equivalent or some future change would break the assumptions
about what INIT_WORK does internally. The init cost is there, but it's
insignicant in comparison to the whole workqueue operation or the old
cost of sending IPIs for that matter.
--
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-01-26 10:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 8:30 [PATCH] mm, page_alloc: Use static global work_struct for draining per-cpu pages Mel Gorman
2017-01-25 9:24 ` Vlastimil Babka
2017-01-25 9:33 ` Hillf Danton
2017-01-26 0:08 ` Andrew Morton
2017-01-26 10:47 ` Mel Gorman [this message]
2017-01-26 19:21 ` Tejun Heo
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=20170126104732.meri27v5lf3or22j@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).