Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp389301pxa; Wed, 19 Aug 2020 04:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrJ2opGm2rBQG3HRTkHCSa/JU+5E+cxSXVdGcPz+yvI4qLaZHe93elSA8l/xvA9WhjIFPY X-Received: by 2002:aa7:d818:: with SMTP id v24mr25175424edq.259.1597836306953; Wed, 19 Aug 2020 04:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597836306; cv=none; d=google.com; s=arc-20160816; b=vFIeE/l75f7lLH7Fpy8QtVt5Yo+5oKtsnNyYHynI4IXHaIe0COcWhe1UZVJLdXpQ0M B3AYmB09LcLk3OxeJroUGc0mJ9uzbSEkO9Llao0v6Ji7goAEJb8ZYdX2CvmwNMfgKMke yL6uk6Q+yBqaKfoTd1dsfpidLzWDFRc6TDujFvUFWZSnsPuIvh/mlNHlpz/sjVff2lIo 2ifdaVQLc7mEUK+6IUy/dU74vgqHOCr54F8xjkNbp/oiB7uYQnLYcOjjuj2ZTIO83tR9 IziRalhp264bkGW0RDYr/ooW3ICoZ7QbnhBCUwlsKZ0K5KL3Bl7/ATLw1bZqJzGXoxI7 h0GQ== 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:date:from:dkim-signature; bh=+U5eYd/WgcHMRRLlJtn8by7HPtPCy3egakxT1iRMnKo=; b=iX2nwvXd6MBpFYtnNmNkoiOAcwXuTl9r82359DdUvH+cu+IXcdvz1XW4tM0gx2bElx K1mqLO065HomvcRZY/aLw10KZwDW0r8glo5n3Ajn4A6nV4GnQ0Om+xn8uCwB0xmcCLg0 pR5WqQLrGiJBX+Bj4V9iOnQU/tZu2qkr6rbUT1WBbSgcTX25gWag29rTvHdsWFS9Vbmu QuCDzRYgmZ3w6UQyhf6pEsE6ivwW5LsfGeYvnlE4E+qAiOq+noGOS2ylOufx5OGqPOjL uauIAj2//tGv2znbvEtEOMYU43Z0nGHUUjmO9yIyo82bgahx9qqIaTOL9GWnHOKCEolZ X6TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YmI1zcvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si15303531ejb.150.2020.08.19.04.24.43; Wed, 19 Aug 2020 04:25:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YmI1zcvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727921AbgHSLWy (ORCPT + 99 others); Wed, 19 Aug 2020 07:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbgHSLWa (ORCPT ); Wed, 19 Aug 2020 07:22:30 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0278BC061757; Wed, 19 Aug 2020 04:22:30 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id g6so24889944ljn.11; Wed, 19 Aug 2020 04:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+U5eYd/WgcHMRRLlJtn8by7HPtPCy3egakxT1iRMnKo=; b=YmI1zcvnGz8pXArCkaWVKv5sYtG7wFwxL2nIk8rm++XzbHiHAJzWpe7JFYEajfCpv9 Ufgvc8Hzs8Gf1FVQU8bPcL1CS42Fs3eqwDExTx54d5h0nTWqE33k1YgWEMKF/bP3IMdx TOEqcBEVVz0nXIgCZ3f3Rz/OTBLnLeuoOlWdeer1vEYak+g4RVxaFGas135IwjLbVLRn H1fzNwVZ4ne5Q24OxhL9IQ3UM/ZJPUBo/LWbdhb5dJaVQMI5+rr0GAdl99lp7AR1z2Z3 vj1BT7KJZHBGx7FgcHOjxST0mG92NYEPyIeaf3NJnlnqBr3Czuv+QTF6q2Qjw17KcoTq gyDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+U5eYd/WgcHMRRLlJtn8by7HPtPCy3egakxT1iRMnKo=; b=mBDrEoed1MWxn+jR/02izjgqqJy7+/2OX6gQ8+eQu5lAJzY3g+eTUxPM309OQstQhG +smCl8hH0otgnNTAUOA/VIl3YC1FLq/2UkoJRszhGLgVVt7OGVqxJLmNP0YbpsS46V1a ewLt6gKJ7RriQ1K8q8mZOudtnIOzdVC5WZnRbIPHlJvX6JkP+BmTHyfmbMtzDWnnuHOS Y7o2nF7N91afX3vsahlnHft1QAQ7laNWgWhhKqP6a3M1BhT48rdqNny72c1MvCtcDaez dE2FmVvlE63o/eNqP6N9efoDMboAOTwyAJ2pXF+ivfBVkDHby6EQwXN1joUdb7XlWz8T BolQ== X-Gm-Message-State: AOAM530HHlyfp2CECjRfxg12yMDiA2fREuPcOxCY2KFeRKl1IEBSAPhA 5qUFSkUtzVcZ9yMTKaPTMXNcT9gUdIXpK/eV X-Received: by 2002:a2e:9643:: with SMTP id z3mr12891342ljh.282.1597836148425; Wed, 19 Aug 2020 04:22:28 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id p13sm7292826lfc.63.2020.08.19.04.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 04:22:27 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Wed, 19 Aug 2020 13:22:25 +0200 To: Joel Fernandes Cc: "Paul E. McKenney" , Uladzislau Rezki , qiang.zhang@windriver.com, Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , rcu , LKML Subject: Re: [PATCH] rcu: shrink each possible cpu krcp Message-ID: <20200819112225.GA6177@pc636> References: <20200814064557.17365-1-qiang.zhang@windriver.com> <20200814185124.GA2113@pc636> <20200818171807.GI27891@paulmck-ThinkPad-P72> <20200818210355.GM27891@paulmck-ThinkPad-P72> <20200818215511.GA2538@pc636> <20200818220245.GO27891@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 08:04:20PM -0400, Joel Fernandes wrote: > On Tue, Aug 18, 2020 at 6:02 PM Paul E. McKenney wrote: > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > > index b8ccd7b5af82..6decb9ad2421 100644 > > > --- a/kernel/rcu/tree.c > > > +++ b/kernel/rcu/tree.c > > > @@ -2336,10 +2336,15 @@ int rcutree_dead_cpu(unsigned int cpu) > > > { > > > struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); > > > struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */ > > > + struct kfree_rcu_cpu *krcp; > > > > > > if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) > > > return 0; > > > > > > + /* Drain the kcrp of this CPU. IRQs should be disabled? */ > > > + krcp = this_cpu_ptr(&krc) > > > + schedule_delayed_work(&krcp->monitor_work, 0); > > > + > > > > > > A cpu can be offlined and its krp will be stuck until a shrinker is involved. > > > Maybe be never. > > > > Does the same apply to its kmalloc() per-CPU caches? If so, I have a > > hard time getting too worried about it. ;-) > > Looking at slab_offline_cpu() , that calls cancel_delayed_work_sync() > on the cache reaper who's job is to flush the per-cpu caches. So I > believe during CPU offlining, the per-cpu slab caches are flushed. > SLAB does it for sure, same as page allocator. There are special CPU-offline callbacks for both cases to perform cleanup when CPU dies. -- Vlad Rezki