Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp376705rdb; Thu, 25 Jan 2024 20:00:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTZzacz/QapbMFwoH5xKeIFDF23nze+OtikTUx7e3xksEaM+c7wd89gRNsAJBGxpi8W6Bc X-Received: by 2002:a05:6512:74d:b0:510:177a:2506 with SMTP id c13-20020a056512074d00b00510177a2506mr356320lfs.136.1706241648240; Thu, 25 Jan 2024 20:00:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706241648; cv=pass; d=google.com; s=arc-20160816; b=YFW2yGPJoa4MWSA1c5fjT9ReaZwDGJEM+D+yu2u5NdInOJNgSY0tTyDrCzGvtae5wb zvtJ0/NYSqFYwT0WCPp9Nk7tvX1FFc3bRgvdVqV1jAQ6F3Ep/x4ywPkumJBzGRWASA9P Xaf++EJmEkxVlC8xfF/Nr7iNP9dKZH97iC658a9S5jKfvVZMsTEE/cOTZes8Ea3oBc/q RDXN5Bm2Ow7QgwZYrcJ3BS4wVyHiLsG54/TgcA3ndd5u6nV66SIeMPt3F/k4bMqf4Zea KKgTccCNvOo7Rr2Szm8BCnJI650AfHv+Rvi5Izp93LSmHS4mgdDqTKNzkxwXPrnGCpLG +8xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature; bh=l9OeCrZN9N7atb9ofVz4/T9GOrOzsVAdW3jedBYP9VU=; fh=y2vSzkQ01DsnkYIHdHJwJuTjfZx9EXWe7xvme7T4GVA=; b=P1S49E0D5C5fJio+rB9vKelj17f2BrbKXP+7AsUfvDlReKx0v88CeM6ZO98z9qzS0u v5clb2p7fZYckZgl9fcmg7Md3XTpzt1Nsf41cfJdwwIrKy/PlLy+xVcPunjJBT7HTpAs fuSresbPsWVEboOww3leFXP1VMUEhOIprC6HaMPEU2KDW2K5Oa6/jWEl2DlrvbzT5soq 69OaIOaNK0mFKNOrR/S2gIYf514/IbG29YsH8+lqHlxDqxrubHbiSlEKOLdU3QW3xb1d 9jLd3nvoP9me9RWT2z4kaO7xmU27O5M1yRKw35yswWNdYgcjbMNwJyt7bgox3AOoOX+A eKNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RejISDg2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-39586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f17-20020a1709062c5100b00a318055fa38si159846ejh.100.2024.01.25.20.00.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 20:00:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RejISDg2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-39586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CEB601F2230F for ; Fri, 26 Jan 2024 04:00:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 426D5134B7; Fri, 26 Jan 2024 03:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RejISDg2" Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E53D5BE7D; Fri, 26 Jan 2024 03:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706241569; cv=none; b=myKDOks0dn/d8n/y9RMnR/Cjhru0Gt1PsMLy1MJD+pkchs8DpdRH8lSNll3YjfW1d5w82IUNDt00hLWFpD4IV4VyhCxVOTqA2Ml1P919pWy79EWmO6SpavOsYEMV7BZPCz9U5jz4Dh7QjhpfwpeS//lf47MXbvhm5RYOnp9TYfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706241569; c=relaxed/simple; bh=WrDRcgmLN8FYE1bEh/kSEtEYeR20GP5oA7YAlESBxuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cWUbn2AyLzRBcPPINmWORMY99ZYVQtvKk0xC7RYnSJ5r9j7pivMSwmMDQw2fjxRRA8ucnt+wKpheqZ2pGnh0qJYKEP1UBz81IVt9q1mI8vQNF9zIy9ZfpIUEHqjVMX4gtRc+Mjxt+daEhSLSbXYOrlneAgOpVe3YuTHeD8HLhn0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RejISDg2; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-429fc7a1eacso61135261cf.2; Thu, 25 Jan 2024 19:59:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706241567; x=1706846367; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=l9OeCrZN9N7atb9ofVz4/T9GOrOzsVAdW3jedBYP9VU=; b=RejISDg2HCAVvd5gT2r/mHdqG6YVhLK67Wzkig7CmTuokSIreiyl/h7JPHE0PaEsUA COZTqh91U4z1DtNEZaom3q7k2sXG0kULLBbVfwWs9S5GIhfaSe7ph2Vh1btsBa9vFemd vF0gPVtMcrU0wo4A5U5v1qruWSpYj+LLynicKr4eKigvsfyWhfd9CB6nA2sZ0UuWPik5 6LPQ3hjLINchdTAEr+9CvGxmv1z2M+iHbLvPl/R8ybH01T5fgkXEWGLLuitrf2MpyRBf WM/yKZ9fBc0ARWg/wV4yTyok2O1XIBtBHJdRoHI1ZJGfD36H1o4qEjEB/cryMPz3sUyp 8r/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706241567; x=1706846367; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=l9OeCrZN9N7atb9ofVz4/T9GOrOzsVAdW3jedBYP9VU=; b=s6/NRzhYIGxH0MJjCf2Jvhdz8ubDNJTj0er5XDTjVbgx4O5aM1oU9DzlgeFenLx+TP JnE84OuEspvjRetmR2W9vIHO3YCiuNFophwV9wIEYVkCOufSj8NdIXBuecmgmqH7sE6z 2vX8B1182KMdOmKLOwUoJac2AYEEUdk65YNKsGb+M9BZItu0PwHi5jjYLPyj0g4EuW2x 2oha2KoQsoNo6JEqR0kOeIzI+Qy7TtN0C8Rqzbj6y8hb6d0/P5uy0N4+8r2C3YyR5puQ SHg2K1ycXIpgmyUpsCmQSh0mehQGhg4tynVcGAUp2Q/N5BiAeElFY0NBbVdsgn0u9jvT GXWg== X-Gm-Message-State: AOJu0YxFHdzn6z3XvPJX5FckJin+uPIxEjxXlIYZJVsmjANS5kYoUjNV lJalOMy9jCtJsBh/Lsaco5bDs+mFfyQkd0/9xxa9RneZ74hv4xR/o/X7dAcF X-Received: by 2002:a05:622a:1312:b0:42a:5a5b:82bb with SMTP id v18-20020a05622a131200b0042a5a5b82bbmr871658qtk.106.1706241566789; Thu, 25 Jan 2024 19:59:26 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id kb8-20020a05622a448800b004280cad48basm145312qtb.77.2024.01.25.19.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 19:59:26 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id F101627C0060; Thu, 25 Jan 2024 22:59:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 25 Jan 2024 22:59:25 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeliedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeegleejiedthedvheeggfejveefjeejkefgveffieeujefhueeigfegueeh geeggfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Jan 2024 22:59:25 -0500 (EST) From: Boqun Feng To: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, linux-doc@vger.kernel.org Cc: Jonathan Corbet , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang Subject: [PATCH 7/8] doc: Clarify use of slab constructors and SLAB_TYPESAFE_BY_RCU Date: Thu, 25 Jan 2024 19:58:10 -0800 Message-ID: <20240126035816.3129296-8-boqun.feng@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126035816.3129296-1-boqun.feng@gmail.com> References: <20240126035816.3129296-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Paul E. McKenney" This commit explicitly states that you should initialize any locks to be used by readers in your SLAB_TYPESAFE_BY_RCU constructor. Signed-off-by: Paul E. McKenney --- Documentation/RCU/whatisRCU.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/RCU/whatisRCU.rst b/Documentation/RCU/whatisRCU.rst index 246ce0d0b4d1..872ac665223f 100644 --- a/Documentation/RCU/whatisRCU.rst +++ b/Documentation/RCU/whatisRCU.rst @@ -963,8 +963,8 @@ unfortunately any spinlock in a ``SLAB_TYPESAFE_BY_RCU`` object must be initialized after each and every call to kmem_cache_alloc(), which renders reference-free spinlock acquisition completely unsafe. Therefore, when using ``SLAB_TYPESAFE_BY_RCU``, make proper use of a reference counter. -(Those willing to use a kmem_cache constructor may also use locking, -including cache-friendly sequence locking.) +(Those willing to initialize their locks in a kmem_cache constructor +may also use locking, including cache-friendly sequence locking.) With traditional reference counting -- such as that implemented by the kref library in Linux -- there is typically code that runs when the last -- 2.43.0