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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 C8B79C47258 for ; Mon, 4 May 2020 20:16:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 909F5206B8 for ; Mon, 4 May 2020 20:16:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="wDsu96lx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 909F5206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=joelfernandes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 284178E007D; Mon, 4 May 2020 16:16:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 234A78E0058; Mon, 4 May 2020 16:16:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1238A8E007D; Mon, 4 May 2020 16:16:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id EE12B8E0058 for ; Mon, 4 May 2020 16:15:59 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AB75219237 for ; Mon, 4 May 2020 20:15:59 +0000 (UTC) X-FDA: 76780142838.26.cakes57_3446f15853546 X-HE-Tag: cakes57_3446f15853546 X-Filterd-Recvd-Size: 4546 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 May 2020 20:15:59 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id s9so29005qkm.6 for ; Mon, 04 May 2020 13:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:cc:from:message-id; bh=qaBBk/smpYuQoJcHKGIGXo6xcNtXI58RrNOOaDplxxU=; b=wDsu96lxuidwPq/rIpPZu8gJisG82ozSRJ7NNj6ko7TtFdbAeYJGVjk6aOy3pV+CtW ajeSYBT41xX1sTt6eCX/FHevjVPJyrOfi9VjVOXFg9SRlaJ4gbccoLaaPymVcY4B3j90 ynUnlrHKv8DrlIgreWhw0bnqw7mXdjv7OQzoA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=qaBBk/smpYuQoJcHKGIGXo6xcNtXI58RrNOOaDplxxU=; b=hVPaE1pVbE400cXQmZHTy0qlhnx7FB+KEaxwN8NgyPH2CdKMe051PT3VC4B5hHR/7O oEaYDSoSyiPKmV7gooL9DZtLp630CipKOFum9UT1JZr/VR68Ls2hOfwBAgVnGTez+Bqn YGkLuCncJyWP/yL+mxFQCXsWQ/EulpSj5oFDCJS9f1LS7IsLnoEsQiAHmJsMtwo1CzBh +2uHMFLKnQHe82FHQiLvqtWuFsE9ItIODvdVkfnE7MqqqgC5v/zWORxw14S3kNZvjsTM LNC5fFSNimPsX4GYW/4CcZPT/LBPSs3qVria0pUCCK17RJubnl8mMoPidtIFoxdFuE8L 4J3A== X-Gm-Message-State: AGi0PubKBOYuqmBo25aySEaGlkGnq1poRrET1qq9eI8csBrtfFTcoK61 AW3Qb4ZjX+u0zS9HipvTFWTfbg== X-Google-Smtp-Source: APiQypJ9UKDVGdImohIT4xO2OUyTFH6NvTu5Y1esqKZOwoVgIWuTkX4/x6/btb32Dtv51R4Y2vZh6A== X-Received: by 2002:a37:8d6:: with SMTP id 205mr120790qki.144.1588623358353; Mon, 04 May 2020 13:15:58 -0700 (PDT) Received: from [192.168.1.8] (c-71-62-121-229.hsd1.va.comcast.net. [71.62.121.229]) by smtp.gmail.com with ESMTPSA id i42sm12553327qtc.83.2020.05.04.13.15.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 13:15:57 -0700 (PDT) Date: Mon, 04 May 2020 16:15:55 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <20200504195128.GA21830@pc636> References: <20200428205903.61704-1-urezki@gmail.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 09/24] rcu/tree: cache specified number of objects To: Uladzislau Rezki ,"Paul E. McKenney" CC: LKML ,linux-mm ,Andrew Morton ,"Theodore Y . Ts'o" ,Matthew Wilcox ,RCU ,Oleksiy Avramchenko From: joel@joelfernandes.org Message-ID: <2A623E6F-878C-4C1F-9045-56710DE7851B@joelfernandes.org> 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 May 4, 2020 3:51:28 PM EDT, 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=2E This tracking could suffer from the >lost-update >> > > problem without any locking, 2 lockless llist_add happened >simulatenously=2E >> > > >> > > Also if list_head is used, it will take more space and still use >locking=2E >> > >> > Indeed, it would be best to use a non-concurrent singly linked >list=2E >>=20 >> Ok cool :-) >>=20 >> Is it safe to say something like the following is ruled out? ;-) :-D >> #define kfree_rcu_list_add llist_add >>=20 >In that case i think it is better just to add a comment about using >llist_head=2E To state that it used as a singular list to save space >and the access is synchronized by the lock :) > >IMHO=2E Sounds good to me=2E thanks, - Joel > >-- >Vlad Rezki --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E