Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1360679rwe; Fri, 14 Apr 2023 20:24:23 -0700 (PDT) X-Google-Smtp-Source: AKy350aMIDeJTvB2l4/eiA5ou5J46LApw34IoJsiAk5myffxnfPMR1qk6TwVmcT5nh3WgNuKSnWM X-Received: by 2002:a05:6a00:1149:b0:62d:8376:3712 with SMTP id b9-20020a056a00114900b0062d83763712mr11407656pfm.28.1681529063191; Fri, 14 Apr 2023 20:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681529063; cv=none; d=google.com; s=arc-20160816; b=k2dhRwowj6nD/DjYTGPg5gxyW8gXzQvhQf6eD8bHVUi88uKSzt2FsN9xbue27vRqrr +Ea2Fvvf79ZDYSmz/TCF6xdoWKS9c+MM5xzPzQVUpg4/I70cC/Lj9CCdP7IARpHRPXx0 +bPTamHtQ9ubMVwPCvAtRZno20IkSpGYrvcOni/mRaespEf+nKQJARqCDvTZkkKtr+a3 SM4R1Mu7K9EZcL/7D9BDHa0qnhPYgChWI0t4IUEily2VmPePH5yYMUzS8JI1nx4UtnFq dLzf0q7CWbX6Tq2IHzpjCRdyXIWPgTrDgW++G80TKQRRMSQoqW5k7CetiOWTJHJShy5A Y9ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ru4GmkmDPbL0zSgOAkqLrZuUJXHhWnW3Y45Awf1/wbo=; b=Z1BHSTFjuAMZrfN0J4qoCPdydLm1LgLwKeQozSFPKdvk8LLY2jokAb9mHsC1WNbwsL ufRuBkvA+lSBaL3gc2FVbDm9cVr0186fAPMZ4zcGpEPAk+GS67+Cncjovv//juXAVuQw rXPJz4Pwmm5+PUUVXw/UyW7pkcV+/wOdYhwBu5uGp+dp3dsecWrrnsxZDMhsGqiFAkZQ xa5lmO3pvtfP5UaAL7AK13JNXSVLqKZyLqYHhJDG7uev30R2ZC7OvWBKu8+aoXIIdicG oBkel1v4Nlv8m3jbCJDTWABV/eqksmmisSwdZ2GoU7Poccqc1wN/veNg0hEUk/sA5OBB IlyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oXcFTfvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x191-20020a6386c8000000b005137a0eb906si6619742pgd.684.2023.04.14.20.24.06; Fri, 14 Apr 2023 20:24:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oXcFTfvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjDODXN (ORCPT + 99 others); Fri, 14 Apr 2023 23:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjDODXK (ORCPT ); Fri, 14 Apr 2023 23:23:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A2A14C3C for ; Fri, 14 Apr 2023 20:23:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA13B64A0F for ; Sat, 15 Apr 2023 03:23:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5449C433EF; Sat, 15 Apr 2023 03:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681528988; bh=AzxKYq5yEA+LGDBj0JIEH82z1x96b37gP4y9wuEr+y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oXcFTfvbBCfAjQN/aRyRZVC9kBXGx/sTAYkV2s4fy+6lg6CoC6B+qpNBkO808//cA DwF62XT16Fg1sJ/OHMoRNgN3TjigxFclihZOZID79ry/tn7S9/lWJzYHOp2RPtEG52 ikS8jmIMJmj+5TxG2GwxEUoUCohkxVYRCYWJ3VeuXXb6NYyj6XRZJvCsms4R5jiDTT Jqqys1+/kJ3c6usm8fo7YK1nbppUeUTZrpLlPS8XfGl7vivCqUjZ8e9bUGiVrqRQUa GwsrqKb53RkHTge/G+cFitmIQow1KZ6slFqMy8CNL0Abc8pPK+wFhJprMJ8T3KUjhe pqQTL0WKFeAyg== From: SeongJae Park To: "Paul E . McKenney" Cc: SeongJae Park , Matthew Wilcox , akpm@linux-foundation.org, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/slab: break up RCU readers on SLAB_TYPESAFE_BY_RCU example code Date: Sat, 15 Apr 2023 03:23:05 +0000 Message-Id: <20230415032305.3860-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230415030452.3223-1-sj@kernel.org> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Apr 2023 03:04:52 +0000 SeongJae Park wrote: > On Sat, 15 Apr 2023 03:51:54 +0100 Matthew Wilcox wrote: > > > On Sat, Apr 15, 2023 at 12:37:53AM +0000, SeongJae Park wrote: > > > * > > > + * begin: > > > * rcu_read_lock(); > > > - * again: > > > * obj = lockless_lookup(key); > > > * if (obj) { > > > * if (!try_get_ref(obj)) // might fail for free objects > > > - * goto again; > > > + * goto begin; I simply followed the commit da82af04352b ("doc: Update and wordsmith rculist_nulls.rst") for this change, and I think I overlooked this part. If I'm not missing something, I think we should call rcu_read_unlock() here too, just before 'goto begin'. I will post another patch for rculist_null.rst later. Thanks, SJ > > > * > > > * if (obj->key != key) { // not the object we expected > > > * put_ref(obj); > > > + * rcu_read_unlock(); > > > * goto again; > > > > - * goto again; > > + * goto begin; > > Oops, thank you for catching, Matthew! > > > Thanks, > SJ