Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1081223ybl; Wed, 14 Aug 2019 10:23:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO+vOBzMTMxdxsiMUsXw+SwoB2goL9SCE501cGBgOn0Wk4FaCO5AISGscIDlMXOK4S7PZv X-Received: by 2002:a62:e901:: with SMTP id j1mr1046442pfh.189.1565803404906; Wed, 14 Aug 2019 10:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803404; cv=none; d=google.com; s=arc-20160816; b=RqDEZoJEmTTxY5MmLH8y1YRyVfa6f5HZKJ3mQpg323O/3le8KM4FN1+WTl82VFu4IM e3cLxRoYbz+XS2ZllOooJj1/NY/V4KDi8Uqs+E7RAbpOORzkh/SSm+WyyjPjQ9RQ9IIT Sj3GAu63V/wzYr/b1Ay/1W4rzvEthiSb1dJVt0JM9L/zBfJf3K0zdMMuVilsx/NtySM5 Rat7IkhnTRCG4hDHD2bh80tjC6/CRX5/MqRrYedIMMWJV+fgeVbhY5zGfyHs447/7hzi yHWST7L54nqAOKUUxQqu83JsPY9yzxET16hXk+Txn7KKR4Eagsif72skx+XUTBxqhTd9 bLTw== 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; bh=tKeZkHVdOTrrbp3L6xiLYQzT4PgNeWVgJQ71pR7Y1hc=; b=jovDCFVLzl4z3SEE0lcqN6L5nR3t/UXcGVzitMeYvit6YZRPSu+X6bqlVi15m8dGZS Tp36bVQzb1w+DAo0h9soF4ovZT5AMWs1phicU6qoA0L6kisHLXxwDD7sKgztuaPF86vq 6ioEIJ30coqmL7GoDfRv2rXYjXC0CaYmo01eXyXMvwfFJ8uT+M++X1npjhZ0ue3N8odz 1XluOfcC2pTEcCPnOhDbpHtROlHKXc2cmFL2fF6XmS319fq34AquslZ75JFu+BNip2I3 ZDMQs004CYABMxwGh5mE+oLaHenRTP4JlZYY3A5mVw9Z2tFWjnbSg3TE3OphwRdyORk9 QNAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Jq1WJLMw; 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 i185si172304pge.505.2019.08.14.10.23.08; Wed, 14 Aug 2019 10:23:24 -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=@joelfernandes.org header.s=google header.b=Jq1WJLMw; 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 S1730048AbfHNRWj (ORCPT + 99 others); Wed, 14 Aug 2019 13:22:39 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41900 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730170AbfHNRWg (ORCPT ); Wed, 14 Aug 2019 13:22:36 -0400 Received: by mail-pg1-f195.google.com with SMTP id x15so43071870pgg.8 for ; Wed, 14 Aug 2019 10:22:36 -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:user-agent; bh=tKeZkHVdOTrrbp3L6xiLYQzT4PgNeWVgJQ71pR7Y1hc=; b=Jq1WJLMwYfOmDtdlMvLrPfs483e6jQtjYKl+AAfH0yGzvtGSJJLPMsWePCTcLNKMVD cy0HrsN51kEFY1pHyD7ey4tjU72XdiwPntsGqoW/lhKTnpsu7S62HWyZQbZymaM13Q9d DIcUGp1c7vxz2uMzIJz7ijs67TMWf04Pssp1U= 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:user-agent; bh=tKeZkHVdOTrrbp3L6xiLYQzT4PgNeWVgJQ71pR7Y1hc=; b=Y2h6TETQ6/H76TS+Wf2oi2UE39TwcOKN6UN01SC5/D6Mus+DLAehGhhheNUTc4bIzT Yw1XmLKJvGGraiN0VfDfMtMNiIDb95N8iYvlna//R7+nEqjDKXTvhm6RR5hPPmuH3UOx 6luyNFEzYjUoqIcQOONCNcjEznBZUuCTfrFDM4FJlkYVjtXfd4g/L9DIH9X0Od0ajh0d mdQNo9aIViCR40lYx4b1u2DPccEwIoeaUeIjfT99Sz2a+No83G9hmK7i+SnqLWMpE32r tm1JIFXa4vrMcul0By+0xsu82zlG1MvyuGSo5h8fFMaMmE0c44fBBYIL6u28iWVyDKM8 G35w== X-Gm-Message-State: APjAAAWlUWjaxrBG2RnmphXKq8481SMTx8/jZ3600sN+jxm8KrP1HT99 /jErj3cbLeciNxhjZJt+dLo1hg== X-Received: by 2002:a17:90a:fc95:: with SMTP id ci21mr804345pjb.52.1565803355964; Wed, 14 Aug 2019 10:22:35 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id g18sm267119pgm.9.2019.08.14.10.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 10:22:35 -0700 (PDT) Date: Wed, 14 Aug 2019 13:22:33 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Rao Shoaib , max.byungchul.park@gmail.com, byungchul.park@lge.com, kernel-team@android.com, kernel-team@lge.com, Andrew Morton , Davidlohr Bueso , Jonathan Corbet , Josh Triplett , Kees Cook , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , Mauro Carvalho Chehab , rcu@vger.kernel.org, Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH v3 1/2] rcu/tree: Add basic support for kfree_rcu batching Message-ID: <20190814172233.GA68498@google.com> References: <20190813170046.81707-1-joel@joelfernandes.org> <20190813190738.GH28441@linux.ibm.com> <20190814143817.GA253999@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814143817.GA253999@google.com> 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 Wed, Aug 14, 2019 at 10:38:17AM -0400, Joel Fernandes wrote: > On Tue, Aug 13, 2019 at 12:07:38PM -0700, Paul E. McKenney wrote: [snip] > > > - * Queue an RCU callback for lazy invocation after a grace period. > > > - * This will likely be later named something like "call_rcu_lazy()", > > > - * but this change will require some way of tagging the lazy RCU > > > - * callbacks in the list of pending callbacks. Until then, this > > > - * function may only be called from __kfree_rcu(). > > > + * Maximum number of kfree(s) to batch, if this limit is hit then the batch of > > > + * kfree(s) is queued for freeing after a grace period, right away. > > > */ > > > -void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func) > > > +struct kfree_rcu_cpu { > > > + /* The rcu_work node for queuing work with queue_rcu_work(). The work > > > + * is done after a grace period. > > > + */ > > > + struct rcu_work rcu_work; > > > + > > > + /* The list of objects being queued in a batch but are not yet > > > + * scheduled to be freed. > > > + */ > > > + struct rcu_head *head; > > > + > > > + /* The list of objects that have now left ->head and are queued for > > > + * freeing after a grace period. > > > + */ > > > + struct rcu_head *head_free; > > > > So this is not yet the one that does multiple batches concurrently > > awaiting grace periods, correct? Or am I missing something subtle? > > Yes, it is not. I honestly, still did not understand that idea. Or how it > would improve things. May be we can discuss at LPC on pen and paper? But I > think that can also be a follow-up optimization. I got it now. Basically we can benefit a bit more by having another list (that is have multiple kfree_rcu batches in flight). I will think more about it - but hopefully we don't need to gate this patch by that. It'll be interesting to see what rcuperf says about such an improvement :) thanks, - Joel