Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4881073rdb; Fri, 29 Dec 2023 17:59:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHD19nWYbh8aV+QCY4B3Pg1HCm6GhtrcgUnDSAYdOzwIpmlYRn5k5HiTiuuFWdxeqCeRDoR X-Received: by 2002:ac8:5cd3:0:b0:428:11c5:736c with SMTP id s19-20020ac85cd3000000b0042811c5736cmr209934qta.60.1703901594985; Fri, 29 Dec 2023 17:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703901594; cv=none; d=google.com; s=arc-20160816; b=nY+HHdqQLEAsrs/EcVY73R3iWq4PZo8xpwcfO0mj3tsD1o3xnnQp4qWdnaUkInUT10 EaI3HF/4imJ7m1ifPYo8jJq4TBwi5QXSRUFGgu4JSn3bMGWw+vZE2g4GGrfWG4cn8YyA 4eWV7s7sMPaL+6rcfYZiD5jSTl9gwiO15nywln5wCBWVgL1H4DfWqKW1pM+vLXPBr60h NC2q9D1Qj5d/QS2PrUr0M1n9hBz+MT801S2nWdFW6ZKLQtiPVSV3bjRE76jaSxOxgSxJ NU7T/tHVrIdeZGaGvuleBUVbfeLe23hJiJbrW67mbK+hmneGYt0ZMXWaeqH6GlhNKTxV LBZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=JcU3tb+go9bUv8N4pKXNlLKJPWBlko6I3J75l+sdqHY=; fh=pvHai+PZt5LffIZ++I0WChek9Xa9cRTyDX+3LL+snXY=; b=HcSyp+iQ5HvT6KBuoWaCwTsGULKCzfu3QcyGmQ/1yJom2Vzum5H2AWpHcaHrFCk2lF nxY+scLXukwHelk4JwxDxSeLAKRY5/AxqzguPUg0JiF65E11UVJjrrcadvyu0syEYgPH 4ldfv8XqHqdkW81OfeHmUxclm/WhiJtlMQeLC/BGYrcrKmlwswbNahGsGr86BMltrxvA W6I59fVScWqDRhMp0hPHUuraMdyHvV0KdrgphlHoAdKeJZ4zQofzi+QRquDozkq/FrrL VbiHU49k3vRt73xEt2viflD30ODH/nYU/+df3ML21IBAPq63KJG47mkxY0Fltq64su9d ba6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iSAfsIj2; spf=pass (google.com: domain of linux-kernel+bounces-13304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w14-20020a05622a190e00b00425e75fa13csi20053033qtc.90.2023.12.29.17.59.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 17:59:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13304-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=@redhat.com header.s=mimecast20190719 header.b=iSAfsIj2; spf=pass (google.com: domain of linux-kernel+bounces-13304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13304-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 A5E4D1C2117D for ; Sat, 30 Dec 2023 01:59:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EACD9187E; Sat, 30 Dec 2023 01:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iSAfsIj2" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13BB31367 for ; Sat, 30 Dec 2023 01:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703901584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JcU3tb+go9bUv8N4pKXNlLKJPWBlko6I3J75l+sdqHY=; b=iSAfsIj2Q7WFhsTeq5E+q0wL1DZhBUDF8lpGgd83Sii3mG0JEj2st1/aqQqVgLEdK3NfZl qmtVOP4ALlthUp52P0Hp6YnO8LDswVVFVm0yzhuL36fdSHqvKyq87M3AoyjQwvvigw/sdu M2AAz7ud2GWOBjUkEx9GFNydcEMaPWs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-83-DTuw2t2cMLie1xpKfxUkvg-1; Fri, 29 Dec 2023 20:59:39 -0500 X-MC-Unique: DTuw2t2cMLie1xpKfxUkvg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AF211C05192; Sat, 30 Dec 2023 01:59:38 +0000 (UTC) Received: from [10.22.16.36] (unknown [10.22.16.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C596C15968; Sat, 30 Dec 2023 01:59:37 +0000 (UTC) Message-ID: <65559290-be3c-4a23-bb57-e6c29c53d6cf@redhat.com> Date: Fri, 29 Dec 2023 20:59:36 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH next 1/5] locking/osq_lock: Move the definition of optimistic_spin_node into osf_lock.c Content-Language: en-US To: David Laight , "'linux-kernel@vger.kernel.org'" , "'peterz@infradead.org'" Cc: "'mingo@redhat.com'" , "'will@kernel.org'" , "'boqun.feng@gmail.com'" , 'Linus Torvalds' , "'xinhui.pan@linux.vnet.ibm.com'" , "'virtualization@lists.linux-foundation.org'" , 'Zeng Heng' References: <73a4b31c9c874081baabad9e5f2e5204@AcuMS.aculab.com> <6eb23a47953b445281e04f5573aead65@AcuMS.aculab.com> From: Waiman Long In-Reply-To: <6eb23a47953b445281e04f5573aead65@AcuMS.aculab.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 On 12/29/23 15:53, David Laight wrote: > struct optimistic_spin_node is private to the implementation. > Move it into the C file to ensure nothing is accessing it. > > Signed-off-by: David Laight > --- > include/linux/osq_lock.h | 5 ----- > kernel/locking/osq_lock.c | 7 +++++++ > 2 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/include/linux/osq_lock.h b/include/linux/osq_lock.h > index 5581dbd3bd34..ea8fb31379e3 100644 > --- a/include/linux/osq_lock.h > +++ b/include/linux/osq_lock.h > @@ -6,11 +6,6 @@ > * An MCS like lock especially tailored for optimistic spinning for sleeping > * lock implementations (mutex, rwsem, etc). > */ > -struct optimistic_spin_node { > - struct optimistic_spin_node *next, *prev; > - int locked; /* 1 if lock acquired */ > - int cpu; /* encoded CPU # + 1 value */ > -}; > > struct optimistic_spin_queue { > /* > diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c > index d5610ad52b92..d414eef4bec6 100644 > --- a/kernel/locking/osq_lock.c > +++ b/kernel/locking/osq_lock.c > @@ -11,6 +11,13 @@ > * called from interrupt context and we have preemption disabled while > * spinning. > */ > + > +struct optimistic_spin_node { > + struct optimistic_spin_node *next, *prev; > + int locked; /* 1 if lock acquired */ > + int cpu; /* encoded CPU # + 1 value */ > +}; > + > static DEFINE_PER_CPU_SHARED_ALIGNED(struct optimistic_spin_node, osq_node); > > /* Please correct the patch title "osf_lock.c" => "osq_lock.c". After the fix, you can add Acked-by: Waiman Long