From patchwork Mon Feb 12 11:54:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 199687 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2380086dyd; Mon, 12 Feb 2024 04:02:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHOkhfaOD1YldMsjcHL9S+Hmc+uhG/RLFuUNvF6P06EfVMHe0mWpkaHZFsKe96DjgT9Y87 X-Received: by 2002:a17:90b:374a:b0:297:187f:dc30 with SMTP id ne10-20020a17090b374a00b00297187fdc30mr7696805pjb.22.1707739329581; Mon, 12 Feb 2024 04:02:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707739329; cv=pass; d=google.com; s=arc-20160816; b=zQ/okIyrlF2gGP9oyGY62j+lFSzKQ5r5p0onyiUhc+jXn+ag1uiGr7yrBnDp+bA59r 39Vnw87LfK/He2c53PUwdBj/9AqNhd5XsX77E4DYQrWTGIo5UKpmGw547xxBA4xbHixs JuObKTmlSzLHl8o1XUxn9lJUEGJl6QIA8QDng3//KuttdVJPEZC80LDnUBgCMg96V3cg jSTwK7hyp0Jxs2Me5zx6xEuZN+rd0DkOnjbFJ3zrGdeNI4utQ85kap8B4vE7VjOlEDFc svTCQrHAJQJ4WH+R2kKkQgFn7VIA6q27Jtgqyftb1bhYDiMHFJKRZX/bSCCqDsd6zOfl /Y4g== 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:dkim-signature; bh=ocDV0xt8N038gP+DLg6dR5T/0PL4+pEI/kg00OQd02E=; fh=HBFFMrcTXSho1Mc1bxF7WrmuVBbj4FAsVQLUys9hnKk=; b=rN91hKSIH3uouEHPGaLKzrYeNS2cd4XMzX8O8gbq0jmLxEchjOaHQX7nICLN+cspvm JUlNuWfgNWVcMhshf3Cut0jMen2RO+28Ig8ptvziq4Ui+09jkYpFSgvxRqaemJbAyVJW SX2ayrvG9AT/gf88VYx37HexclGAs1PKs8MQkQbUD8/Ols+YHSA2wBQ9p/+a3EreDTFt 7bjMVkeXi8tT7OMy4gV2z9JPeLlUCEgbipX1razJzRbqApEUdokQm73ytK3WFF+fy8q5 IV+wy8lCyTjBbhijI1APQa7NhTV1j6USjEibHJSMGBBTAgsE2ucLkkzgV+6Ii0QhWeya i12Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=IZJmx41s; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-61487-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61487-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCW/76Qh7z34jcR6ax46HN5ltGHBGhOJ5QzCWMVaay69NfnWZsrLcmYaoOkd/QD/AUX1uKGCKLMl0AI1LTEORYRZmQajfw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id eu15-20020a17090af94f00b0029705e96d0esi183550pjb.117.2024.02.12.04.02.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 04:02:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61487-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=IZJmx41s; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-61487-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61487-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 55FE1281E54 for ; Mon, 12 Feb 2024 12:02:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35B583FB10; Mon, 12 Feb 2024 11:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="IZJmx41s" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 D62863B796 for ; Mon, 12 Feb 2024 11:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738943; cv=none; b=Y8s6Xz8QS1mz2B5A9oSybxP8msJ6VLjQBQVslGVbgfg7AUpIQF7ve4RMr/Wiy/HMC0Diyksc71MySAuAwhzqIxJIKHCBjOuaOGkSXpHo+RgvzRhWJMjw4ppOScwpVLfC+xVnBX/h7e+ulz1hh3Zayi1+pmd1BkjxCm/FVnnj6rE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738943; c=relaxed/simple; bh=k0CWYvaaB/gYg4+a4TXJ9LeyRASwAqQNiIxSmINjJE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EhjeUd1znelsfbQduBXl4iBwubZp2QZNKgbe1/jc8T+xXlfLHHgpEExbmSk6rWuYjaHCXDMyZEM+VGzMPjvLXWAMM6y7hFO7XOUZp3AoH5kM3AlpV2aZtTOmpIZ8AxJd5WeZ9Du/iUwcn+c/dgGq1bEe9ns2XAdqfdccdh9t6ig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=IZJmx41s; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a26fa294e56so418849166b.0 for ; Mon, 12 Feb 2024 03:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707738939; x=1708343739; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ocDV0xt8N038gP+DLg6dR5T/0PL4+pEI/kg00OQd02E=; b=IZJmx41sQB5e85MUhmyaPgaaKJ3MKSfH3br843ZYr4Bnvbuoar6+gGCwEMo1Y4WOq7 9wF7raaxCnybVi5aIiSbPm1C8sNtAu++rLq0CZQ2c9QeH+SrIIwaT+Rvqb25xpgJJKfE B+KIllN3nqvSpRsR5S071nSXq8a3WA01m3KG4H4f9p0Bt6D7tmHgnpkkhAVLCUFh8ZWx lQwATZYUBuPCx6GEfYwIZy+vALaXjmArT46Z9MW0O1InTGZJgwKlNx3PQ30TdyIqEA+B IILGXGOX8YgcwJNHlbLkG94IxOH4swpZOOA1qLvl+TgH/hALB6nAu5sBxwqb158YLFi5 PN6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707738939; x=1708343739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ocDV0xt8N038gP+DLg6dR5T/0PL4+pEI/kg00OQd02E=; b=qS/i0b+tnrbjpFzSv2nhC6/4SM1l7xEPlYJdqhNVsJHCJBp9L8RQlPi7oLdCBinnZX 86DW+o7NcAZHd8jR/Le0NeWu+EOHURMaTuZE9jQRpCUrKeWkvWMZPbkFDqbv38EWXXLU JSAO4tqX/1uDLOlUhCxSvdBKJh5TV1uUDdZ4mhB2WNO0wFmMX6OiER4rvRmb0pWGH18Z L3zH3ipUm/A4DxSEcXFZhb2IzhtiRWUsnMEw6WJJa7S5ZvgffTHpSJDx369meuVc9IV7 mqrnGc0PQBT2Sat6mxPotG9FcafDE9ERyVhIY3EoRRJZ3PlmgsoGOPBLvmoTVvzHwInm rBow== X-Gm-Message-State: AOJu0YzO+LDXhFUIX6jfcWpUYGPKPdRpbNAP+Oqi6rG5SA05I13xD/84 HFRB2UBw80x39RW24YOeHlzBrh0ZUmOVWpX8p9VK6EGcV+hGj16ZucPEB/w8vCVFTJKG/GO1dit n X-Received: by 2002:a17:906:d10e:b0:a3c:caf8:9f8f with SMTP id b14-20020a170906d10e00b00a3ccaf89f8fmr813966ejz.61.1707738938950; Mon, 12 Feb 2024 03:55:38 -0800 (PST) Received: from raven.blarg.de (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id m1-20020a17090607c100b00a36c3e2e52dsm139203ejc.61.2024.02.12.03.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:55:38 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v5 26/35] percpu-rwsem.h: move declarations to percpu-rwsem_types.h Date: Mon, 12 Feb 2024 12:54:51 +0100 Message-Id: <20240212115500.2078463-27-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212115500.2078463-1-max.kellermann@ionos.com> References: <20240212115500.2078463-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790694475224867184 X-GMAIL-MSGID: 1790694475224867184 By providing declarations in a lean header, we can reduce header dependencies. Signed-off-by: Max Kellermann --- include/linux/cgroup-defs.h | 2 +- include/linux/percpu-rwsem.h | 15 +-------------- include/linux/percpu-rwsem_types.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 include/linux/percpu-rwsem_types.h diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 878deefba0e1..691c50aeafae 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 36b942b67b7d..0f427bd5217a 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h @@ -2,24 +2,11 @@ #ifndef _LINUX_PERCPU_RWSEM_H #define _LINUX_PERCPU_RWSEM_H +#include #include #include -#include -#include -#include #include -struct percpu_rw_semaphore { - struct rcu_sync rss; - unsigned int __percpu *read_count; - struct rcuwait writer; - wait_queue_head_t waiters; - atomic_t block; -#ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map dep_map; -#endif -}; - #ifdef CONFIG_DEBUG_LOCK_ALLOC #define __PERCPU_RWSEM_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname }, #else diff --git a/include/linux/percpu-rwsem_types.h b/include/linux/percpu-rwsem_types.h new file mode 100644 index 000000000000..0716d08b758b --- /dev/null +++ b/include/linux/percpu-rwsem_types.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_PERCPU_RWSEM_TYPES_H +#define _LINUX_PERCPU_RWSEM_TYPES_H + +#include +#include +#include +#include +#ifdef CONFIG_DEBUG_LOCK_ALLOC +#include +#endif + +struct percpu_rw_semaphore { + struct rcu_sync rss; + unsigned int __percpu *read_count; + struct rcuwait writer; + wait_queue_head_t waiters; + atomic_t block; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +}; + +#endif