Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3582455ybz; Mon, 4 May 2020 05:57:57 -0700 (PDT) X-Google-Smtp-Source: APiQypIYJ3Myvxa5Y9cOz1w2WgwYmLjo0S5NR9YYE0NdS+ipSDCuQZfMJINX/TuCrrNDhu37MkzC X-Received: by 2002:a17:906:809:: with SMTP id e9mr14232535ejd.81.1588597077491; Mon, 04 May 2020 05:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588597077; cv=none; d=google.com; s=arc-20160816; b=PTPSrCzy5e3TBRNPHGtJUgTJdyJRcZqLvARVK9bI4/4GNuPWQ9s8FuPZNYi+mv5vH1 3aI+XBHVpoa1ejHItA54yM16J6uty8o/1aU/n2qgKMCJy4wNcLxCTw9NucxzPBvYn+V+ RIncfrsDZTZpOf641j6oSAWG4yTCp++mEQ3Df2jW4hcNH6BewetcFI3psRtywbQBpaah 4AW8U90LJYoBYS9qhseDZPlpBmFi8E/I8G+2h3Mfl8EbybT4X4Kv10MPN2KGEumTLibP 2oiIRBq7QQXVO4giFmqn97sD6wthxS1/WzAOAZYqd3+AVeBViyYlGlU+V3nh2/s8kxV6 X6xQ== 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=MxtvJADHQyF2Bfyd3shzrzOV9msYv3TiT6BAQiW+KhI=; b=p9o4c+iSqX8UnPXiGGBqPfqWrv90TYqJf4XSU5JCOmaURr3hW0vMulZSvWubN+wuFs 8NoZ3O6GH+pZSsxbYtrmSnX9Okk3E5OUabzYm9R7qh5cxIl4O4pvgQilLjNWQfa4UUky fbCSBWkmFfQ/wsNYOLCKzra+Z/iG7sdEUK2FRH3hBG2fXqaTaiWgcq3i7ND72PHPxdIL 1Umvh9raRUDrGN+AymkMjcbO9sC2Im2ipgh6FD4GyTyzdPLkFClkF8xsKOC40SUAJztq aVOphlShbLjOk16qfxVl2QThPF3G8yMr5T8HCINFez80DgLYm/FUha9nhVxdyQQ0a5nU 1R5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f5hrseaH; 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 4si7546341edh.424.2020.05.04.05.57.34; Mon, 04 May 2020 05:57:57 -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=f5hrseaH; 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 S1728415AbgEDMqC (ORCPT + 99 others); Mon, 4 May 2020 08:46:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727950AbgEDMqC (ORCPT ); Mon, 4 May 2020 08:46:02 -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 E773CC061A0E; Mon, 4 May 2020 05:46:01 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id w20so9544537ljj.0; Mon, 04 May 2020 05:46:01 -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=MxtvJADHQyF2Bfyd3shzrzOV9msYv3TiT6BAQiW+KhI=; b=f5hrseaHOwjQMXJt8bBACt6DaEIHexL3hv/OOA/rVyWM1tWtk+sIH+NdF5cNVNVhN5 qKA3GFB/imTK1sicAOYYj5xW2DmIA1vbJtN3nk43C2BxXlCOZGvEx5+HaoDiOr0gEe8P b9lbbtykY/8gFZ6dtFAMjZILSNyQvimUYRYp/7Hoj4yjX7fjaJVEZZZkmghiiaVuqkxJ Izl12k3Dleo6+leSUvmD8e66qM+dCmn9I9WhvGAhO02Ng8NufCBXJ1FPhKWQKrWb0gER m293HKARydc4lfUPPSyYtWXgHLYleszKk75AXRlG6i2h/n+v1SbECwX4b1SjTDdKXb/s QFtA== 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=MxtvJADHQyF2Bfyd3shzrzOV9msYv3TiT6BAQiW+KhI=; b=A1eWNLWpdckPYK5/KZrtmCgO3IzRlea3sLVCe+DcKl4JyRIPpFarTNPu6PWAd1gz1q hoJNQSVaMH1gP4mE9+u8JN/DuWn7vpm1jeEDWYbx8mE9o8bTdPl4lnyCetf0DfORNFwL 6yAwvZp/p18f1XpC3YM+2bPMNi1ZqifyaqMkNcaM0HaXMvReYNE0pyqfoxE7uAZ79His VLuPph7EJqZGiihAi9Ml4kuJZA1eV6scvp3uQiWQ7Fj2Vgl5Kg04hKJ8rxyneGfDOgu6 A3holIqiIU+9lv9omOWX4p+yTfE1TyR0UMIe3bfxl/FuupgSexrFcyGa9vxaHzz/08Po j3Tg== X-Gm-Message-State: AGi0PuYUldTYuzvmQ6poLR6PM2r++iMEi3UXHVFNl+KKqXvxVQZCNG7M GFBMKuIoaZUYBGx6naYphgk= X-Received: by 2002:a2e:9048:: with SMTP id n8mr10552753ljg.122.1588596360414; Mon, 04 May 2020 05:46:00 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id s8sm9570030lfd.61.2020.05.04.05.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 05:45:59 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Mon, 4 May 2020 14:45:57 +0200 To: Joel Fernandes Cc: "Paul E. McKenney" , "Uladzislau Rezki (Sony)" , LKML , linux-mm@kvack.org, Andrew Morton , "Theodore Y . Ts'o" , Matthew Wilcox , RCU , Oleksiy Avramchenko Subject: Re: [PATCH 22/24] rcu/tiny: support reclaim for head-less object Message-ID: <20200504124557.GD17577@pc636> References: <20200428205903.61704-1-urezki@gmail.com> <20200428205903.61704-23-urezki@gmail.com> <20200501230638.GI7560@paulmck-ThinkPad-P72> <20200504002700.GB212435@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200504002700.GB212435@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 Sun, May 03, 2020 at 08:27:00PM -0400, Joel Fernandes wrote: > On Fri, May 01, 2020 at 04:06:38PM -0700, Paul E. McKenney wrote: > > On Tue, Apr 28, 2020 at 10:59:01PM +0200, Uladzislau Rezki (Sony) wrote: > > > Make a kvfree_call_rcu() function to support head-less > > > freeing. Same as for tree-RCU, for such purpose we store > > > pointers in array. SLAB and vmalloc ptrs. are mixed and > > > coexist together. > > > > > > Under high memory pressure it can be that maintaining of > > > arrays becomes impossible. Objects with an rcu_head are > > > released via call_rcu(). When it comes to the head-less > > > variant, the kvfree() call is directly inlined, i.e. we > > > do the same as for tree-RCU: > > > a) wait until a grace period has elapsed; > > > b) direct inlining of the kvfree() call. > > > > > > Thus the current context has to follow might_sleep() > > > annotation. Also please note that for tiny-RCU any > > > call of synchronize_rcu() is actually a quiescent > > > state, therefore (a) does nothing. > > > > Please, please, please just do synchronize_rcu() followed by kvfree() > > for single-argument kfree_rcu() and friends in Tiny RCU. > > > > Way simpler and probably way faster as well. And given that Tiny RCU > > runs only on uniprocessor systems, the complexity probably is buying > > you very little, if anything. > > Agreed. > Cool. Agree also :) -- Vlad Rezki