Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1023710ybj; Tue, 5 May 2020 11:35:59 -0700 (PDT) X-Google-Smtp-Source: APiQypKLnnKfEhnWI9hph1DNZSa45l/GYbTxsRABCHB2IXLW6EmSOBBzEhcEbSKF7whe9OezQPb3 X-Received: by 2002:a17:906:6845:: with SMTP id a5mr3827961ejs.143.1588703759099; Tue, 05 May 2020 11:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588703759; cv=none; d=google.com; s=arc-20160816; b=TDnQUnPz3SnAY/dep/AuOQhR3mN2un6ly/pU8vIMLEPA4MfoxeNP8E3AXjlRpclEyK x2VDn2rCnJXkGWsryLXuNec2JIxpTgFgn/rnW25SFMW3DHYS88ba7ltYNSRZZGn87BEY aHsu2w224Kh9WkIzUWMZyHg8iWDkKfatlMgUWfhl4fVi7fz10iVeAb2sB4uZglMQ8eSL 923ppuTdyKgn8nk654/sNxgn9PSxP6I4j3cOjuH8aRmRtjpiCnrj4evcGe7NdIBts9Aa gkDNdBruzLuqXN01aGVfcpB4rdqZO83l39GrkyNOCUAMeFfoSq/XhoomHQUbWL2sNBOI 92Og== 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=1A1CLPbro2Ce0m0/sfeeckkizp6g/6oLtB6WnuAQzhQ=; b=NvCRUKNQLYs7nwRJNwaXIMdbsI1L+NXS61h++SEiWQGp19VsR5TbXQztI3pt6X1sql AfXXLvB7rwIh2EAGPE2hCXb9zwVUlexk3bbnCdSGlmygw7R2wv+z2vXPylqzp9MEOt1L AhPXq9DDSv16nhVPUb+L2WZsMB/8DkC29trCQeiiTXORYG5tKUt8sscnagi9wnfsSNdO zDi8lX5CGocy0zf8W1zN/ibpAA+tTLKQAlFHFDvNKk3HZFnXTtAif+/q4h05P8ImeMaB 2IEog5CSXKaKyJYguQic3eOWXacfq1fngYfNcdFJTfSQmDaK1TP19mi3RfmpT3DfbzEt FFrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RWLdkhnm; 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 d24si1641440edy.387.2020.05.05.11.35.34; Tue, 05 May 2020 11:35:59 -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=RWLdkhnm; 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 S1728660AbgEESdY (ORCPT + 99 others); Tue, 5 May 2020 14:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbgEESdY (ORCPT ); Tue, 5 May 2020 14:33:24 -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 F0B08C061A0F; Tue, 5 May 2020 11:33:23 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id f11so2730879ljp.1; Tue, 05 May 2020 11:33:23 -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=1A1CLPbro2Ce0m0/sfeeckkizp6g/6oLtB6WnuAQzhQ=; b=RWLdkhnm+FEgBbgZFjFXx6x04F7jV8MEc4+8/X5DTOQjZId9DaJO0l9dsiHpH7FIeH M+ovPPzMId8URTefVJFmFWf1ZTt+biAH27fHxgl2IZ1OYqzBWs0elXTJnDKQW/IL7JLy mebWXsF1ilwXrRdf8/3DXqm597YL+4xz6xmmr2RG8/A90LbNGQpEoU5EYn3Sv3hQ9r2B zlxsA3nLssGFLOuYMOR9T22IheC0k/q+7aTPyoLVepm4dELKyuZq7vBm+TDvuHl8VEqw ot8gvaqaMe+dNI85evH059SIUavAcWMf5VUfzFr22ufkHjsoIABOaZlnwl5TPnhuisuq HkkA== 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=1A1CLPbro2Ce0m0/sfeeckkizp6g/6oLtB6WnuAQzhQ=; b=pnRQwFqiPzpKYLE8IImaJGupvP4NuXk61+oYlGlLYCPCYp03DZhxekUexnW+zhLu82 XRpc+L53EOj1G9THXdxlnr0E+IZ7pB/yWq8zRqDB2p0egwbrkm23unYC5jJxH7YD/wKd Z2ylc9WyKfpMhpOLao56yLC2yoXLd7ceI5Wxvdmjew1qrTcQDJ/mcCXnP+3QWYRhrT6c FWZjTWWAzfMDXCFfQI/D3waYGd/sUQ9S3ThlUjHJCi9VtFheUUImzwOt3Ywn2hICg++z lFZiIFrnwhWg1+DsUzEWnQP+GM9aQZwepfG0OzModxemPhUIRP8QDGn5gAkAnec/Wrvr 5dnw== X-Gm-Message-State: AGi0PubwcE6p9tySgxgZapOdAcNWktkGG547QzkPJAhzRPqsKp6aMaJ2 G6dapc464e+eUoU4IrmtSlo= X-Received: by 2002:a2e:7d0f:: with SMTP id y15mr2659763ljc.91.1588703602392; Tue, 05 May 2020 11:33:22 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id y21sm2297981ljg.66.2020.05.05.11.33.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 11:33:19 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Tue, 5 May 2020 20:33:17 +0200 To: Johannes Weiner Cc: Uladzislau Rezki , "Paul E. McKenney" , Joel Fernandes , linux-kernel@vger.kernel.org, Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , rcu@vger.kernel.org, Steven Rostedt Subject: Re: [PATCH RFC] rcu/tree: Refactor object allocation and try harder for array allocation Message-ID: <20200505183317.GA28175@pc636> References: <20200416131745.GA90777@google.com> <20200416180100.GT17661@paulmck-ThinkPad-P72> <20200422145752.GB362484@cmpxchg.org> <20200422153503.GQ17661@paulmck-ThinkPad-P72> <20200423174831.GB389168@cmpxchg.org> <20200423180249.GT17661@paulmck-ThinkPad-P72> <20200423182750.GA32451@pc636> <20200423192115.GV17661@paulmck-ThinkPad-P72> <20200423195955.GA476@pc636> <20200505181743.GA109369@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200505181743.GA109369@cmpxchg.org> 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 > > b) Double argument(with rcu_head) > > This case we consider as it gets called from atomic context even though > > it can be not. Why we consider such case as atomic: we just assume that. > > The reason is to keep it simple, because it is not possible to detect whether > > a current context is attomic or not(for all type of kernels), i mean the one > > that calls kfree_rcu(). > > > > In this case we do not have synchronize_rcu() option. Instead we have an > > object with rcu_head inside. If an allocation gets failed we just make > > use of rcu_head inside the object, regular queuing. > > > > In this case we do not need to hard in order to obtain memory. Therefore > > my question was to Johannes what is best way here. Since we decided to > > minimize reclaiming, whereas GFP_NOWAIT wakes up kswapd if no memory. > > GFP_ATOMIC also is not good, because for (b) we do not need to waste > > it. > > Waking kswapd is fine, because it's a shared facility that doesn't > just reclaim on your behalf but on behalf of a central goal: to get > the freelist back to the watermarks. If they're low, somebody will > sooner or later kick kswapd anyway to do exactly that. > > So unless you ask kswapd for a high order page that is unlikely to be > needed by anybody else, you're only doing the inevitable. > Johannes, thank you for the clarification! -- Vlad Rezki