Received: by 10.192.165.156 with SMTP id m28csp566323imm; Wed, 11 Apr 2018 03:57:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+dfyOwWE58xV+4TGWmf+86zLZhwgrVtZOkjF7P7Z80rv7/u3BubMg37IOlLh+MERcIIzyR X-Received: by 2002:a17:902:b2c8:: with SMTP id x8-v6mr4602239plw.83.1523444229106; Wed, 11 Apr 2018 03:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523444229; cv=none; d=google.com; s=arc-20160816; b=ocuwEEUmNiEmMjfBQvv+VH5uah+SQMAo/HyRccojBhdkGf6iTLmlGfPisjpks+Pi3j clAUJAUtEeiueRD28HsgVrJDfsRVti/bpLWsavQkE92ztZLddXuWJv2TSbJ2ErnzrDln WGiy3LHZ3eBGZq1lGC39GWGVXIgztDM1IFmmJTHdwG4n3NN+9mz9dIHu7DpxCAc2v6vU EzUUh6hj+7Gn9GJEPRczia1IAHz0o4HTPCygcyaM5gLxbr+E9c2k/4Bcw386aWf/pr86 dyyLssm43bjMF8W1EMIZCpsPfAOOT/ENfVrjuyfbX187rvrG7wKWoGazQE6CnFRx45Z7 p4nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=qlk5brFjN+vBOOAfYujARMR9/1AlSPqmklNNSgeey3E=; b=urgQ5phEJ5b1fnpBcafP5hjrbhgDt/OTM84HOMTn//DF5jJDs3YIbyAW8Gw+rd26bG m366Maxb0deLOH9Lkna+6kweCXLNWZ9C1dbq8MYlvDzAYOwTVuP36KO/s6dQwt2XwGmv vREXe1bc5EPLMpgajkSAqc29zNEvziavCfQBVP7m38/Oe/1x5gp5f6XsROl2DviBqT7b paquq6giB9FaTEEwUL2DC0Ri5DU1iMtwv8CPJto58eJUo0tmF1RV8V8Ce9MjyVjM2ih6 3MqnnSKFjKHExLe0NygooGfEdu4ZDgj/5IR9B0z1s4hod9xtBgNj2PcS7fpVHJeqp1Y0 FE1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=bGsnCErj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8-v6si915765plt.6.2018.04.11.03.56.32; Wed, 11 Apr 2018 03:57:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=bGsnCErj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752865AbeDKKxV (ORCPT + 99 others); Wed, 11 Apr 2018 06:53:21 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54877 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbeDKKxT (ORCPT ); Wed, 11 Apr 2018 06:53:19 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2102020C00; Wed, 11 Apr 2018 06:53:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 11 Apr 2018 06:53:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=qlk5br FjN+vBOOAfYujARMR9/1AlSPqmklNNSgeey3E=; b=bGsnCErji8U698Krdwxb1+ 31n2UeAZDPWZlKY1a2UPT/bEtV+jgGKoGE+H8yqdU6+4BoUlhLnjo8Vd0VSmjJg3 hjBYIcdMU17Kqx3dW9fVQs8jvrrfJ1gLzqyySeVx0K7UrS36jBunkuLYlfmlDHxN x9clCedgEyWc4HWyhRTi1RyAlMPOKHfSlF1oIjlpqfvSRkioofiZlCIUzDZx4wYi F18rD5DM/eV/HCNDDsm7pV8R9+i0m/1MoDQkA5e12tthT4E2voAmu69fMJyFNhJc fdekV/UbMPYz4gwz8wvkdxtxGdbAvmBDPyYO6mc2s3fLhi6Oni92J6+UpRPtIHaQ == X-ME-Sender: Received: from Pekka-MacBook.local (81-175-247-183.bb.dnainternet.fi [81.175.247.183]) by mail.messagingengine.com (Postfix) with ESMTPA id D46E4E4F68; Wed, 11 Apr 2018 06:53:14 -0400 (EDT) Subject: Re: [PATCH] mm, slab: reschedule cache_reap() on the same CPU To: Vlastimil Babka , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Joonsoo Kim , David Rientjes , Pekka Enberg , Christoph Lameter , Tejun Heo , Lai Jiangshan , John Stultz , Thomas Gleixner , Stephen Boyd References: <20180410081531.18053-1-vbabka@suse.cz> <20180411070007.32225-1-vbabka@suse.cz> From: Pekka Enberg Message-ID: <71010251-e1bc-e934-cecf-ae37a1cede90@iki.fi> Date: Wed, 11 Apr 2018 13:53:12 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180411070007.32225-1-vbabka@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/04/2018 10.00, Vlastimil Babka wrote: > cache_reap() is initially scheduled in start_cpu_timer() via > schedule_delayed_work_on(). But then the next iterations are scheduled via > schedule_delayed_work(), i.e. using WORK_CPU_UNBOUND. > > Thus since commit ef557180447f ("workqueue: schedule WORK_CPU_UNBOUND work on > wq_unbound_cpumask CPUs") there is no guarantee the future iterations will run > on the originally intended cpu, although it's still preferred. I was able to > demonstrate this with /sys/module/workqueue/parameters/debug_force_rr_cpu. > IIUC, it may also happen due to migrating timers in nohz context. As a result, > some cpu's would be calling cache_reap() more frequently and others never. > > This patch uses schedule_delayed_work_on() with the current cpu when scheduling > the next iteration. > > Signed-off-by: Vlastimil Babka > Fixes: ef557180447f ("workqueue: schedule WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs") > CC: > Cc: Joonsoo Kim > Cc: David Rientjes > Cc: Pekka Enberg > Cc: Christoph Lameter > Cc: Tejun Heo > Cc: Lai Jiangshan > Cc: John Stultz > Cc: Thomas Gleixner > Cc: Stephen Boyd Acked-by: Pekka Enberg > --- > mm/slab.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/slab.c b/mm/slab.c > index 9095c3945425..a76006aae857 100644 > --- a/mm/slab.c > +++ b/mm/slab.c > @@ -4074,7 +4074,8 @@ static void cache_reap(struct work_struct *w) > next_reap_node(); > out: > /* Set up the next iteration */ > - schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_AC)); > + schedule_delayed_work_on(smp_processor_id(), work, > + round_jiffies_relative(REAPTIMEOUT_AC)); > } > > void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo) >