From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F1CDC47256 for ; Tue, 5 May 2020 11:03:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C6588206B8 for ; Tue, 5 May 2020 11:03:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cwTwCOS5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6588206B8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3953E8E00AA; Tue, 5 May 2020 07:03:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36C6C8E0058; Tue, 5 May 2020 07:03:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25BFB8E00AA; Tue, 5 May 2020 07:03:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 0E0F38E0058 for ; Tue, 5 May 2020 07:03:26 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BDC3B18F40 for ; Tue, 5 May 2020 11:03:25 +0000 (UTC) X-FDA: 76782379170.18.wound11_5819e124b3646 X-HE-Tag: wound11_5819e124b3646 X-Filterd-Recvd-Size: 4919 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 May 2020 11:03:25 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id t11so1002380lfe.4 for ; Tue, 05 May 2020 04:03:25 -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=3xkwFF5dOZ2RDq1UBB0lVLNrru5zFIMvLUOVpyqz6+A=; b=cwTwCOS54pbErQ0fdBL0vS5S3Xmjp0kGkcjQ9Mhy2iaiJyjwkzD+TqlF1jmFBbyeEP BUV9Zsfr25k9IaOv5MXTIpgfsy1u1mOp4YlVSgr/iY65CjlDB1BnwOuC7lKFtYmLYwT8 PS9Cy4bjxxteruOhfDC79Zas3dmzaIV56RR3WqnSJRjDC41zQe3GlI4Q+D2foz78gRBa 5a2qXJuyVz5jWF2OkbwNBGJyRvCF+2jJ+H4AavhCJVSiZOHfGuoMSu9dUIH6CYqyf87u LeCEc1K3XDMHzpYykjTYKoknLk9rT49Ia+kRFuA9GiVDtY4v7TX0NFpm1uf+Aw5r9UgG 8V7g== 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=3xkwFF5dOZ2RDq1UBB0lVLNrru5zFIMvLUOVpyqz6+A=; b=AWjPYIpViZoiEI15WMdS3hVhExS3In2Kv3hKuqKs55w14dXLhb1IdZcMTY95+IRQmx GQbkKp1EiZl3sBuPvoC6qb8LrVKAop0bgpXx3jHyS3AItV6tsgmnnNI48aEg6Jm+VPkJ 3tFTZ9yigRNABHWcBrQ4/8zJDVGPtvsBKi/Eh279VeU30618gnh4q6IQocveAhk2Vkgp MYro/144xc0jh35Ix+kKr1QzJvlNj2vrNOVemzehfMT2rYrIg0ZIRV9Q9SmSb8Fptn7a 9ZfXc2GttPAMGcam6O5xlH5U1Du2AOX1c5RUjnasTgTMiIO+1g8gVKuxi6uI3EIbAwW1 hkNQ== X-Gm-Message-State: AGi0PubhS84cvUO2lOIgGnd4iUKfmkAwYbym62lyXL1JEXY4B5Pnxv6i TZvmb8+XB8Ze0AUZFjmn7HA= X-Google-Smtp-Source: APiQypLfCp0VzDXdDAXX3f8TJDDjAIHyi4mv0Mb8SM26DrkQwGwewhY9Wsmw9Yer7x+37mKK1DS36A== X-Received: by 2002:a19:5206:: with SMTP id m6mr1320669lfb.33.1588676603679; Tue, 05 May 2020 04:03:23 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id k6sm1487807lfm.91.2020.05.05.04.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 04:03:22 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Tue, 5 May 2020 13:03:20 +0200 To: "Paul E. McKenney" , Joel Fernandes Cc: Uladzislau Rezki , Joel Fernandes , LKML , linux-mm , Andrew Morton , "Theodore Y . Ts'o" , Matthew Wilcox , RCU , Oleksiy Avramchenko Subject: Re: [PATCH 09/24] rcu/tree: cache specified number of objects Message-ID: <20200505110320.GA23774@pc636> References: <20200428205903.61704-10-urezki@gmail.com> <20200501212749.GD7560@paulmck-ThinkPad-P72> <20200504124323.GA17577@pc636> <20200504152437.GK2869@paulmck-ThinkPad-P72> <20200504174822.GA20446@pc636> <20200504180805.GA172409@google.com> <20200504190138.GU2869@paulmck-ThinkPad-P72> <20200504195128.GA21830@pc636> <20200504201641.GV2869@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200504201641.GV2869@paulmck-ThinkPad-P72> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, May 04, 2020 at 01:16:41PM -0700, Paul E. McKenney wrote: > On Mon, May 04, 2020 at 09:51:28PM +0200, Uladzislau Rezki wrote: > > > > > Since we don't care about traversing backwards, isn't it better to use llist > > > > > for this usecase? > > > > > > > > > > I think Vlad is using locking as we're also tracking the size of the llist to > > > > > know when to free pages. This tracking could suffer from the lost-update > > > > > problem without any locking, 2 lockless llist_add happened simulatenously. > > > > > > > > > > Also if list_head is used, it will take more space and still use locking. > > > > > > > > Indeed, it would be best to use a non-concurrent singly linked list. > > > > > > Ok cool :-) > > > > > > Is it safe to say something like the following is ruled out? ;-) :-D > > > #define kfree_rcu_list_add llist_add > > > > > In that case i think it is better just to add a comment about using > > llist_head. To state that it used as a singular list to save space > > and the access is synchronized by the lock :) > > > > IMHO. > > But adding such a comment would be fine as well. > Thank you Paul and Joel! -- Vlad Rezki