Received: by 10.192.165.156 with SMTP id m28csp1350323imm; Wed, 11 Apr 2018 17:51:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/aZ/MXLJGMn2aHKR8ijaMiOUIO7ufrhN1l8Ch+/57KX0l3N+fYQ5/UEr/BuPlN8SBcS5nl X-Received: by 10.98.178.20 with SMTP id x20mr5895618pfe.32.1523494299296; Wed, 11 Apr 2018 17:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523494299; cv=none; d=google.com; s=arc-20160816; b=CkbmmaK4q6W4YUFEMFfWGrk98e4AAn+Ep9gKnvlvhNtuNCLI8ZSsvYiV8vzjcVcnLg eSxVY0co+bJBiEKM1j7cEhMVfa6Fcl6jA9DPttYo6ioHq+DgbWN3pJblhRg/VY0ezOAx Pkgx2zMKZnqUv6kdtNFBYJBNMHScz9/KpfI1S0iWdw66kn469w5PZ2YdHGxucDJ31/ka cRqPUlTmz6lWJ5znAJy5DoUGyKLdlDdsL1D2AmpAjN1CV4RMqhQitY0iPTrTe3UVXP4j /il5LY/1vAw2crdjC9UNMBqqmMJEvT4F3Li7eCrKMvhKqe95WNIH5wV3G4+MViMDi/1k t7zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=3Nh3WCDESuJMjEpn9vfVkH6Cbmd5a1Y0RTvLMzScBUI=; b=lxV55ptndFGOMWEIVxn69+Pb2h5CORWa8Xil2PssFyvNr3P9ElVSjf6f5TgY9kQsCe l567Hx1OKiDcQskT1he90+z2q3WMmf1tCA0lTdeJbaMsMatOAGqZA+Klu+OHj2K4tIt5 wPvQ+5GuuvyGW4y3MBRNPEkFZWPLdkrzGqOueMvCDCdmR1/V3Pboc+Yz0Wy+GVc3xgCR JSXncqfLsKnGo1rMSlirFpiOaR0E2+ExhrFgWJ6oXcQwFglv9XXjLTrN+OVfWltDzb0e 4PTla5NAYnHt2Vn004ASq15uzVUibrxs0Zm7zMBxCf2hnNC8FNt9r6JamHoVBo8apn7b bfWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=N+7aiN2v; 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 a3si1431813pgv.522.2018.04.11.17.51.02; Wed, 11 Apr 2018 17:51:39 -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=fail header.i=@gmail.com header.s=20161025 header.b=N+7aiN2v; 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 S1752406AbeDLAr5 (ORCPT + 99 others); Wed, 11 Apr 2018 20:47:57 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33482 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbeDLArz (ORCPT ); Wed, 11 Apr 2018 20:47:55 -0400 Received: by mail-pl0-f67.google.com with SMTP id w12-v6so1734037plp.0; Wed, 11 Apr 2018 17:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3Nh3WCDESuJMjEpn9vfVkH6Cbmd5a1Y0RTvLMzScBUI=; b=N+7aiN2v5LhSlys7d3Kr1ElYX11Qlt5XUAQsNYEK0ScGAIx+EwrB3Pd56y4B22HL83 kRqIhRZrGStqb0ORetmX/4O5XNpSDJcAtWV7xKoi2DZL88NLTi/Qe05RNEwY7pVDVaXx p6xR9OWUgqhX5DcYautmO2gr42lcEUEtBlnPYGCgxuRQVDcexRtFovMDpIg4rldBmJvP Z7VE7JsaohhjqSbOuSQGbrNdE5kC5PwdycqUINfV95S9fFTtNlbC1dWYb/ke/YXNO/cs WzgO+YNoaX2XZpJjRnF/ulwMlFhNBP1bzvQ1W8zDEvKV6r7s6yDbOG17YTMms2s3EnDS RGaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=3Nh3WCDESuJMjEpn9vfVkH6Cbmd5a1Y0RTvLMzScBUI=; b=A3Trsb2fEXozWply+litGDHDZdpV45U+nyvMO13sFiJKXG2Q9xcu8YiuZc2XVgQgI0 q8z/XyJrWXTdDzvN3pmQjKLUuU5G4DCIzxkllpZK0YGS3cI039mZ7d2II58HsMJszT+N W6BniHQ3L8TaFEcgRXXxfStMzBzi1+0cfv1nk0Dnt7DT+ossKHgXb50wYJ+ohLq57Me3 Kn6JXblBVH2PMR06tnTG2r5S7YHyjWUMoUpVA8AnRK32vOosSLdWiCY7MtULVB8CG/bM G8KjlGvOwxpKE7APazinY3ajDwmYmnxWyZ015ogE+PeYHkCiBDHDoqRIH2eIYTRZ5CTE YBPg== X-Gm-Message-State: ALQs6tANIozw8MfDowpghw6XyM8Qi269ixniKu5RhjPqjiTdjOOmtTOi OHDtCZjgPXEOwQ3i8QdHP66H/j1g X-Received: by 2002:a17:902:141:: with SMTP id 59-v6mr7531514plb.219.1523494074476; Wed, 11 Apr 2018 17:47:54 -0700 (PDT) Received: from rodete-desktop-imager.corp.google.com ([2401:fa00:d:0:7630:de9:f6f2:276f]) by smtp.gmail.com with ESMTPSA id x17sm4468889pfm.161.2018.04.11.17.47.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 17:47:53 -0700 (PDT) Date: Thu, 12 Apr 2018 09:47:47 +0900 From: Minchan Kim To: Vlastimil Babka Cc: Andrew Morton , 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 Subject: Re: [PATCH] mm, slab: reschedule cache_reap() on the same CPU Message-ID: <20180412004747.GA253442@rodete-desktop-imager.corp.google.com> References: <20180410081531.18053-1-vbabka@suse.cz> <20180411070007.32225-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180411070007.32225-1-vbabka@suse.cz> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2018 at 09:00:07AM +0200, 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. Could you write down part about "so what's the user effect on some condition?". It would really help to pick up the patch. > > 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 > --- > 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) > -- > 2.16.3 >