Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4771012rdb; Fri, 29 Dec 2023 12:54:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJEv5NFkQvK3Sk0FKuGFoh8qy0b555YYv0CPlEMe0yLxGWgYr00U/DlXfUy1B4VCiVDoXt X-Received: by 2002:a05:620a:2721:b0:77d:c863:b991 with SMTP id b33-20020a05620a272100b0077dc863b991mr15387140qkp.20.1703883259057; Fri, 29 Dec 2023 12:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703883259; cv=none; d=google.com; s=arc-20160816; b=zwaRXImMa3RCbuAgLGPkMj0Q1tTdG2OvAw0tIEfeOlcMkPkO/fbQwdW01GDg+EneVv Qn3kuoevKLGhFM89ez3RvaNH13CgPLwzJM4/VcXo8RVhYirLgJrHvjFgHJaybrDjCrk8 UIS2I4L5bXDdvOFgTsuWF+rEmFMdHlYKGUYbQAWOMvMUe/QDoT9kL0rIYGKJ8U2WunoX zK79TkIJhHsjtbgtG7NvkRNURmuZuUGRzRqY5YvVrnuVpe4Mtp8teeNowZKuABnipcAL XzlJHFwy2Gg/WDt0Jy5AWxDnt/ujtJKvo50kQExzO4TdLrmxukmReEbyRdTQsAEuuwGC luOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=G9/EWqwvS6OUBoOv/HML40lGhLdvo6eopLHweDpBNTw=; fh=9mjHhe+fO0FRmfh1SiQmAZ16aLlCaXA7AOG78MgCddY=; b=G12KFeC+tlmtwl6igkI+6Asrh2o5slWXBGuZlzl1vJxAbUS/iIFoWeUwdett9Ckgut VivmXockFSNBT1vc99pf/swiIpVWNFBZ06S2sVPfL0xQHs60MFGeoB/nmjuCU3SqZ+TS IIO3Wsn0Gch6q/RdyvjGhitpWiExbCOiwB99OZP3p2y0KIwLAr1Sh5Mji7HPscG0eRBN fcO9mB+GfCbq2Cla0v2tEqfS7eA3EQG4+3+YHYZxysXgdYof9uNidAC4hblGJ7D6Y/ai PjeKL4YnYRim0O/oABBlMFTkw5GA9cjLxayB7QZjhvOgKXrGlogJiD3PRS90grpZJyWw 1FGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y17-20020a05620a25d100b00781a2bcb489si435743qko.600.2023.12.29.12.54.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 12:54:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.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 CB52A1C2185C for ; Fri, 29 Dec 2023 20:54:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2115314291; Fri, 29 Dec 2023 20:54:12 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (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 E0F4914267 for ; Fri, 29 Dec 2023 20:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-79-fRwTi2a-NdGsmCtHse5L_g-1; Fri, 29 Dec 2023 20:54:06 +0000 X-MC-Unique: fRwTi2a-NdGsmCtHse5L_g-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 29 Dec 2023 20:53:49 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 29 Dec 2023 20:53:49 +0000 From: David Laight To: "'linux-kernel@vger.kernel.org'" , "'peterz@infradead.org'" , "'longman@redhat.com'" 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' Subject: [PATCH next 1/5] locking/osq_lock: Move the definition of optimistic_spin_node into osf_lock.c Thread-Topic: [PATCH next 1/5] locking/osq_lock: Move the definition of optimistic_spin_node into osf_lock.c Thread-Index: Ado6mSDjgxSGtr3xT6CXt/ONPypOxA== Date: Fri, 29 Dec 2023 20:53:49 +0000 Message-ID: <6eb23a47953b445281e04f5573aead65@AcuMS.aculab.com> References: <73a4b31c9c874081baabad9e5f2e5204@AcuMS.aculab.com> In-Reply-To: <73a4b31c9c874081baabad9e5f2e5204@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 sleepi= ng * lock implementations (mutex, rwsem, etc). */ -struct optimistic_spin_node { -=09struct optimistic_spin_node *next, *prev; -=09int locked; /* 1 if lock acquired */ -=09int cpu; /* encoded CPU # + 1 value */ -}; =20 struct optimistic_spin_queue { =09/* 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 { +=09struct optimistic_spin_node *next, *prev; +=09int locked; /* 1 if lock acquired */ +=09int cpu; /* encoded CPU # + 1 value */ +}; + static DEFINE_PER_CPU_SHARED_ALIGNED(struct optimistic_spin_node, osq_node= ); =20 /* --=20 2.17.1 - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)