Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp162579lqd; Tue, 23 Apr 2024 19:53:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4+e5nKex1Pz2WSVJ1/s39En2wh5UFt7KKeVsdEaGLaJHc6+pLekIWw/4hk1nT8YX1NkBXkPC33LmREYMM6jzB3J3YzUT3JjaZwuq8IQ== X-Google-Smtp-Source: AGHT+IEdOcqV6BC+sb+dptzwOBlqn+TFkbX+bsOY/qj3kqclkvlllHW1vdxFpgOXPKNeDLkUoWdD X-Received: by 2002:a05:620a:404a:b0:78f:1897:56cd with SMTP id i10-20020a05620a404a00b0078f189756cdmr1720406qko.6.1713927232401; Tue, 23 Apr 2024 19:53:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713927232; cv=pass; d=google.com; s=arc-20160816; b=lH8yAI6au4Ip9Y4qAcU6UZ490tKhtj+e5BLtDZiQNHuoXR4r5gKRw3+XoSn5q7RBlw LoaBgpEw3Tq9CD0hpQsZFvoDqdkA8Q9mjghPJB+pFu+pzUMR+oS8y99Reh49DSNnN3k/ wLoR+VjU4MOcO596BeXl2OIUGhdqwkfK0Y9zdH7UVtHTNKWX+iVpPeiaSsZKCQkKLdwV ZdL2pbqAxUyUzfxM6OVfDpoUi+qkHOXr+2h0YqFa7pbymHlYKaGmwNuDZmyUW25fm/1f ZVO6/3VJMRwJrUxb+wrSxwT1snCVfnYCeTdN9X6IpAP/+wMGWkboY7rS4+SXR/WN20FE VokQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=TmqU0PrGd+2IylBkSE4S0tLQ+pmhWNt4mrMys0RAJYA=; fh=RqFpVtPniqoAfjYHLQ803vKAFbYxmlqvXEnxjt1SqQI=; b=OZ3Zdso2MyKpl3WbmB6naOTulSkJvdeIbhX87Zm4D5LuVS4VNy2TPALeU0zqxPj3IU IpkQxm9Gfb1M+8fW+Bh3GBV688aRHhPeW9bvNuvfkxKYoOGo/SV1o8Pqs49JBINC0Woq K+XQRvUurfD1vQcvHTxxG1uubfTNMv7DoZ9p+gWEAAGqyEu/0RltbbbYZkr5cR5U7kYc J3Y9GH2TwjBtO7PRT7/584Ht+c7EBp/rJ0CKJAxkpOwulDAZy02W9SZg2rr10ow1dwAZ cuKKxb1NzVT40JRasSfr6rq/7U0BYDMe9SaW6YwBcWG7PkFodWEgAgt3iq/evVIvAW4o bVFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dUxePWuK; 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-156175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y7-20020a05620a44c700b0078f06ee7590si16069727qkp.259.2024.04.23.19.53.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 19:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dUxePWuK; 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-156175-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156175-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2670D1C217C8 for ; Wed, 24 Apr 2024 02:53:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 345FD83CB8; Wed, 24 Apr 2024 02:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dUxePWuK" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 132C68F47; Wed, 24 Apr 2024 02:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713927224; cv=none; b=M6aQxjup4gaTJ4jRfcS0zk+F+z+0VJmYeWJW6rIHXFaTWJ22x5IwHrwJRGcAwIygRFlchTYkWmm2tbOoYRThjxAUnX1P+vpMjkROXshpUa21cMY3zt990ALcSvpG54lvfogbfk/NVUvwqkEAvBAqZnL625FkYZ3v8N3h7h0N4mA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713927224; c=relaxed/simple; bh=yTCwB5MKwpTb9TeIS1+gfR/A4L8mMnu2aKsPl0GCDSA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=I5PMTKafusSaU18az0f3ukwP9sPBxDztzq3nwTyMm8OuvQ86KVKiLz1e7YPFuSkJRhiDv8gH+4kXVxKOVGrGUDKiWRfSHligVJsYlxUfhE+ipRZmHBFABWnvecR7g64jQpDYNyjPgx+cLhoZxYIojTuX/ky0vItbHncTV89HKTc= 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=dUxePWuK; arc=none smtp.client-ip=209.85.210.171 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-pf1-f171.google.com with SMTP id d2e1a72fcca58-6f07de6ab93so5977539b3a.2; Tue, 23 Apr 2024 19:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713927222; x=1714532022; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TmqU0PrGd+2IylBkSE4S0tLQ+pmhWNt4mrMys0RAJYA=; b=dUxePWuKWvnSAjVODpa5LgFO+cWfxMypOZ8i5fypb4IgDLf7vIz5csaGjpLcrR82uN keUhijRsK3581771Mbve6O+AsQbbccDYbhiEIqC8N25+61THMJ+ckbGE3REOoRitzW+v 1t8wMgYXVD4vBtCyShBT5eHx33MlAKkM/PkOcls3nEH0siF0kONfBGMfmQ55XCNGgwcV jdzMY0GgygJyIYKv0jDDANmv1Kr4jRIZPqM+oNkwSLmeYqsGAxSbDVX4yNSC8g+ecMwt XfcQlIUz7l7bJaVXCEUUtbgQzn4nSamRZrRKuqyvZqAqm24teh9M3dm5klRikDtbSWVH pZ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713927222; x=1714532022; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TmqU0PrGd+2IylBkSE4S0tLQ+pmhWNt4mrMys0RAJYA=; b=Nuopk5gVFnTTJujBFDP6KNAC5No2ySB/0t/OOv+d1SmQCc1QUfX80V50d1fVLYW8+H Rn/7o/gl2BlohwBDSC7zDcyOjMUOMDuWojuhHWiqC62AMy8iLJ7xy2UGo47mK/hVN2b9 oeacMhjbaRM1DpFsFjPyG2o+WpuuZmc8tMA2BcZdl6LD86d06BbfQCabzxCKmdlgbOfB j6jLY4fIPP8mN5hjyCZ1EN5dNx/nmSmyhgGS6fi32sCFLM23bUnM8zyx6tJTXxFLc9+N O0utjjYiqb2ilaHLGSvJOeJ5l5A4RcFKOQog5yYSOxN57z6cVNRxNYKclBiHbJwPpfDN nfEw== X-Forwarded-Encrypted: i=1; AJvYcCUHncSzbcNWsJT1ZeRwA0HPXjfNbTb77s6Zw07/uyQNQ+XFgvTSQNK6WuE/yHyTIMc/D7puiobaTb7KjdtZU/B7Jl1n X-Gm-Message-State: AOJu0YxboyV4gcGLkfc2T5rTr+TryLmXxKjv0cp9SoAjqImBooNctPU3 BD8aChW9OvW+vqltSk+JCMpDqySxPhGXGt/MD1Ixpk2WXJGS9YtdEZxjKmsR8kLNzIQMGWAvgv8 4Y/hLnrzBY7smoNR0B70rR2c/BKY= X-Received: by 2002:a05:6a21:6802:b0:1aa:5fb4:87ff with SMTP id wr2-20020a056a21680200b001aa5fb487ffmr1262636pzb.14.1713927222330; Tue, 23 Apr 2024 19:53:42 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240407090558.3395-1-jiangshanlai@gmail.com> <20240407090558.3395-11-jiangshanlai@gmail.com> In-Reply-To: From: Lai Jiangshan Date: Wed, 24 Apr 2024 10:53:30 +0800 Message-ID: Subject: Re: [PATCH V2 10/11] x86/rcu: Add rcu_preempt_count To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, x86@kernel.org, Lai Jiangshan , "Paul E. McKenney" , Peter Zijlstra , Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Uros Bizjak , Josh Poimboeuf , Breno Leitao , Kent Overstreet , Pawan Gupta , Rick Edgecombe , Vegard Nossum , Daniel Sneddon , Nikolay Borisov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2024 at 2:09=E2=80=AFAM Joel Fernandes wrote: > > On Sun, Apr 7, 2024 at 5:06=E2=80=AFAM Lai Jiangshan wrote: > > > > From: Lai Jiangshan > > > > Implement PCPU_RCU_PREEMPT_COUNT for x86. > > Mainly copied from asm/preempt.h > > > > Make rcu_read_[un]lock() inlined for rcu-preempt. > > Changelog is wrong. You inlined rcu_read_[un]lock in previous patch, > not this one? The previous patch just adds the non-arch framework code. The incline only happens when CONFIG_PCPU_RCU_PREEMPT_COUNT=3Dy. This patch implements PCPU_RCU_PREEMPT_COUNT for x86, so rcu_read_[un]lock() was not made inlined for x86 for rcu-preempt until this patch. Thanks Lai > > - Joel > > > Make rcu_read_lock() only one instruction. > > Make rcu_read_unlock() only two instructions in the fast path. > > > > Cc: "Paul E. McKenney" > > Cc: Peter Zijlstra > > Cc: Frederic Weisbecker > > Signed-off-by: Lai Jiangshan > > --- > > arch/x86/Kconfig | 1 + > > arch/x86/include/asm/current.h | 3 + > > arch/x86/include/asm/rcu_preempt.h | 107 +++++++++++++++++++++++++++++ > > arch/x86/kernel/cpu/common.c | 4 ++ > > 4 files changed, 115 insertions(+) > > create mode 100644 arch/x86/include/asm/rcu_preempt.h > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > index 4fff6ed46e90..e805cac3763d 100644 > > --- a/arch/x86/Kconfig > > +++ b/arch/x86/Kconfig > > @@ -256,6 +256,7 @@ config X86 > > select HAVE_OBJTOOL if X86_64 > > select HAVE_OPTPROBES > > select HAVE_PAGE_SIZE_4KB > > + select HAVE_PCPU_RCU_PREEMPT_COUNT > > select HAVE_PCSPKR_PLATFORM > > select HAVE_PERF_EVENTS > > select HAVE_PERF_EVENTS_NMI