Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1567318

Re: [PATCH] mm, page_alloc: Use static global work_struct for draining per-cpu pages

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, page_alloc: Use static global work_struct for draining per-cpu pages
Date Thu, 26 Jan 2017 11:50:02 +0100
Message-ID <t3PMS-6fb-17@gated-at.bofh.it> (permalink)
References <t3rhv-7QP-3@gated-at.bofh.it> <t3FNw-iY-11@gated-at.bofh.it>
X-Original-To Andrew Morton <akpm@linux-foundation.org>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-15
Content-Disposition inline
User-Agent Mutt/1.6.2 (2016-07-01)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 22
Organization linux.* mail to news gateway
X-Original-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>
X-Original-Date Thu, 26 Jan 2017 10:47:32 +0000
X-Original-Message-ID <20170126104732.meri27v5lf3or22j@techsingularity.net>
X-Original-References <20170125083038.rzb5f43nptmk7aed@techsingularity.net> <20170125160802.67172878e6692e45fa035f37@linux-foundation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1567318

Show key headers only | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm, page_alloc: Use static global work_struct for draining  per-cpu pages Mel Gorman <mgorman@techsingularity.net> - 2017-01-25 09:40 +0100
  Re: [PATCH] mm, page_alloc: Use static global work_struct for  draining per-cpu pages Vlastimil Babka <vbabka@suse.cz> - 2017-01-25 10:30 +0100
  Re: [PATCH] mm, page_alloc: Use static global work_struct for draining per-cpu pages "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-25 10:40 +0100
  Re: [PATCH] mm, page_alloc: Use static global work_struct for  draining per-cpu pages Andrew Morton <akpm@linux-foundation.org> - 2017-01-26 01:10 +0100
    Re: [PATCH] mm, page_alloc: Use static global work_struct for  draining per-cpu pages Mel Gorman <mgorman@techsingularity.net> - 2017-01-26 11:50 +0100
      Re: [PATCH] mm, page_alloc: Use static global work_struct for  draining per-cpu pages Tejun Heo <tj@kernel.org> - 2017-01-26 20:30 +0100

csiph-web