Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp463614pxa; Wed, 19 Aug 2020 06:29:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5NKEXb/ikcMHI817FvcLBGBIdz+OCxf/+wix8szEOtcKrYYMoMnblqdRGFvVkzJ9cYB5O X-Received: by 2002:a17:906:ca4f:: with SMTP id jx15mr26345543ejb.449.1597843747677; Wed, 19 Aug 2020 06:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597843747; cv=none; d=google.com; s=arc-20160816; b=SEip62yw8ahBeENQboa/yPJMpJSMFeWcC0r7rp8aFtFhBo5xpXZ3K6tBCKWmCkhcC6 eMX3fhAU2gWbocLckUCy/RDOuFWBPKh7xfuFKdbzlNNucd3saWpRTTfrNAX6bQTOk9AE ILFVoh4fvHx+l1bWaEr6WtKQmF5A60WPG+PLA1+FfSRg2Rb3kY0NnqmuQOaE3QiQNlB+ wOd0kUcpFlbapsQuNE0+7vT1gZEZPzUOTTfWoI1sA2jrN25lU0jAGhuk9wHVaAmKcgaw vkN4yLD71njRJNLGGV88qmq3wSZ84hNw1M/cfPOQud9WYyFCJ9XoKZg6FNAr7EAo9EMs W7aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Oub4DT+nxeyPZAIUHhbv2Qd15f55cLS7blrm9y7LqSs=; b=fBmc0lngn2VfAhhh+IWjVT4EGWfvWiF9OWSt2/otKQ3EjilUa2uIBVACGNuZNuvX5A m0nj3Xp7rEXaszdk+V9UrHYVKdbhSyDPm1tgDWA8JqV/7S+sCvNGvaEYYrw09+vCsz36 iP/kUHaD1B9JUQi0WEykkKZSdl4FyoHkGGHJ9+T6VVOx16rkQKWLeSRlNi2PJ99P+w73 9qVASBjI/ZOg73+ZTVkf706nwVHo1iqgGehpuXplVyH3LAlDll57hkosbScLiT1nHRP8 E8OoLTQIHpmrY2rimco19762QvxMJBtgyHt/P/HHWTdzjZejWqg4payc58RoF2LVLcYc jNew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=msumWpjb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h27si17677450edj.279.2020.08.19.06.28.43; Wed, 19 Aug 2020 06:29:07 -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=@joelfernandes.org header.s=google header.b=msumWpjb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728533AbgHSN0T (ORCPT + 99 others); Wed, 19 Aug 2020 09:26:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728149AbgHSNZu (ORCPT ); Wed, 19 Aug 2020 09:25:50 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7BFC061757 for ; Wed, 19 Aug 2020 06:25:49 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id e5so17693881qth.5 for ; Wed, 19 Aug 2020 06:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Oub4DT+nxeyPZAIUHhbv2Qd15f55cLS7blrm9y7LqSs=; b=msumWpjbrhePPIDAQHg1nPaSE6QdJ/aagtAu8huGWKROwE7Lm5xEcnwQEk+fEcE3mT 2wNeytscDzHCfUzb8oqpmWCUrFsI+JPLDn9OjfXVxKjdW8u9BvFNGEsQ7Z8TIa0heSlQ wHRS1ejxR8mCzVMfuWJ2dkU9a2To2cXLqzYPk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Oub4DT+nxeyPZAIUHhbv2Qd15f55cLS7blrm9y7LqSs=; b=tuWfuq+KbjaCgbnv69SqAXH7vDcZ1XteoYKaOKGJwjlhIiGk9aaXOq2Ia2zb9w7oao HcxCcxBGAWDFQxF5fZWKadJ80m2ykU2KrBFjlMCgYA9lHGAvVMj+J9+G1j1098/tVcX+ VU79VXPBp1GPTtTQ5PnJeLtF1gBZxliVvcFvrxhyDFkSGNmttlpZVmMmYzSFZcUGDpUy OK7tAWT/Wj8MvnAPaBFD+dW1QSOOazjYFDFBeFnBCPnEzGiXzA+hpfKFJhRW2u5KcDKB IhaQEqFlsxjysE2cAdJO5SBrh5wOUuKYrEnbAQUFb1FfWT0Wi3bAZEpxxRoz+3zlcwCr 5ZwA== X-Gm-Message-State: AOAM530/drlq2/j4IhiQkFRIo0P3LMKEIVB7XceSe2LWgUisg/IsZUnf oAxa9rnEXdkpQ77gGBblTIv6dA== X-Received: by 2002:ac8:6052:: with SMTP id k18mr22205327qtm.60.1597843548673; Wed, 19 Aug 2020 06:25:48 -0700 (PDT) Received: from localhost ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id d8sm27287911qtr.12.2020.08.19.06.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 06:25:47 -0700 (PDT) Date: Wed, 19 Aug 2020 09:25:47 -0400 From: Joel Fernandes To: Uladzislau Rezki Cc: "Paul E. McKenney" , 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: <20200819132547.GA3875610@google.com> 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> <20200819112225.GA6177@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200819112225.GA6177@pc636> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 19, 2020 at 01:22:25PM +0200, Uladzislau Rezki wrote: > 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. Got it, thanks for confirming, makes sense. thanks, - Joel