From patchwork Sun Feb 11 23:15:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 199542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2143502dyd; Sun, 11 Feb 2024 15:22:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVGViDfVUkM7bBsPfEpD8kGH5/IqgcLQvjwDCQKJ++AnxXyNmrXi9zgnHkgQYYCxNy4OfiyD9XqH80r+M+R4103qEKr9g== X-Google-Smtp-Source: AGHT+IEuVDo/R7yXrA5uls2hFpMAdsPxDiMcZjbqIkP8E0WhbhIiVCI8ctvNq9p+P9ZCJCw7yxqJ X-Received: by 2002:ad4:4ee4:0:b0:68c:9d36:db88 with SMTP id dv4-20020ad44ee4000000b0068c9d36db88mr6802837qvb.6.1707693750233; Sun, 11 Feb 2024 15:22:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707693750; cv=pass; d=google.com; s=arc-20160816; b=rSyhLw4fB1oPPSlUaBeuCca2dq0Zgs/io0e9fP3rssrBZpOEUdp+bwnaFENDafo9mg BltER3bx2Ym855n2CXaMRAjDtTnw3PMdmW8YXLCgz8YvUUcnQAK1eK4FonXnn8GmcxQG e1m862g+to6QphEpurICnsWjk00AEg9WT47jEPmX/nSOo/9d77gvl0rxa5HRa8P8+Jen nUesRGXqpHcCnhD9fQr4h4RIww3Y+GtcRNWxtIJSKgigKQ+VagCXeQWd0Sg58ZkEQs7Z rO4x+Aza1tUnOch92J1kAeQHs+DiEJtr04E9+eGgkmBGjEd9ovw8KWk8xw5JWyFImefI GRmg== 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=xgYk20V6NWJZCNja7YOWk4V9REFcJwrtlmJFQ4awEDU=; b=ZXRJaD0nS1xH9B3k6QF4kYALfKI/e5B+FzL6F/TeQf3jWVwH9b4a2Ql+fJGab/tmGg UUJkoSpEc9PIbZ3ICp/+r4FoPbSrBNWwg74FT3eFvjCGgAYWWtki3TBrv9qa4+Ph8T22 hclt13231A6B06P+DSOi79c7NWYnFtRQVbLHcNcnTPzFKpI0abCX8TkrpNej9kn8hjqP 2PYjnMr4banIImLsLs3gjDey3zPpXHI4k+hpzRq7xy0YbZ2Rg+fkC6XZo7NHxa917G+S BIR3E4kC0gbWVdd3yCpypK6nRA2L42dnpkydgj+UzU2rSdA33nKnOQua9bWZJIeT6LSF wbCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=NiRTcq+I; 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-61009-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61009-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCVrX0uxAzb1+kGgO3d80F3fGnGYnqkaClBcb3MaV9S2xp2Mm/yJa7zArvj/nCuZR7TGhNCCPp4vRp30MeT1dcyXPosrvw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kj14-20020a056214528e00b0068d00d8943bsi3314521qvb.562.2024.02.11.15.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:22:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61009-ouuuleilei=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=@ionos.com header.s=google header.b=NiRTcq+I; 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-61009-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61009-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0B7D51C217C8 for ; Sun, 11 Feb 2024 23:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C944C1799B; Sun, 11 Feb 2024 23:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="NiRTcq+I" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.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 B7CAE2B9A6 for ; Sun, 11 Feb 2024 23:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693363; cv=none; b=MT14WpdblMHojW+JX7bU9wMcmyFrBLOSA8DsKyPTVMAjTw5LaJwOUcMTcMBwGJWxgN4WQQyB+uFKwFnl+9WZwvwAe0pz1STdVreerWxZ/JW1M2AFJnEsF3N4+u+XOsAxsUeNCAvzFL+nn3hg/4lHfMBi+D1ejzNCwwnkdhQZSXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693363; c=relaxed/simple; bh=k0CWYvaaB/gYg4+a4TXJ9LeyRASwAqQNiIxSmINjJE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nnhKf4CxOpd/Wkpth1YqfltFg0TNU1wiBM1cfxL6RR8UWNX+Q3GSV/lpwL2UPkHXPA+IdAW2t2OnHEGFHis1419oQgYvRs9A6G+9HC9fZFLBZD/urx/EWJhYR/Vyf3uSErklrfBzCt6b17iJFXu6I5hsRXPBt8UK5A93WB32mJc= 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=NiRTcq+I; arc=none smtp.client-ip=209.85.208.171 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-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d090c83d45so36389591fa.3 for ; Sun, 11 Feb 2024 15:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707693358; x=1708298158; 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=NiRTcq+IQX0Ma/0Wo/A5yxG4/1JOo0IG+zY2bnTzAWVxNMjMPOEQLUJ/oIqYaN9U9g sbYf6XLlrunwWfvMuy+40IhhrTPJGcGEG5ABaLYuYgJO7RvHgRhSUIo5K7ejQtyKUNAv 30dSO873aNjNbE1NW0J1wbzTUQ9+hGVGL09zhczb+DOq1upMCgz3WpYtV8kKYMy3KQj9 b917fNkpTuyHzyeFRCEIROo6UUWWW1sxTcOFPEYE5p9SAJgzTpwKfqS+LvWwQofogd/1 fp8LSmgvA5/Q0rUPYGccsmRGSs2eFQQodrL2EMRBhuMzGZSEt2PK6GTGdkAk1uCK9C0x PGRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707693358; x=1708298158; 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=KdFH5LlbEQCkNnHpyAh4mHNa+8cQCiHgWRIhvCwfvv6m6cWB8tE9A5yBUT8cFvUvGr QYb5mlnBIOCnbI3U6eARpAZrra3WBG6dvo9pfNaJsOWNac710pAdezIckaWN2k2UJeMa K44CmlVIrN7ZX4DaExWvtTWkTf4sqP2DTyfxQwgq3qBefltwq/Ox2/XupVnFuTg0lA4N iYQkshyE5V0Ld6qRiNLpZ17ZaQKGUD/7re6LiuKx8yJiXxHqT57hmB4GRQFESzelr7s8 HQM6kryIOPchWT5XLOBSplC0WI2eM0FJKvGsHl3R91AnAHZmVj3AY0PDuINAJHS14iAp +Sow== X-Gm-Message-State: AOJu0YxLnnxcRt4qGuGXTzIUo/gKYL1V1jRBjTsJX7lzlTtlMZ0ghKxC b2L0Xs4X/ENX45EuTQ2rRp6JvvuaFWzbXCoIavVADzs04cn91l8LfJmP4D5nhSJinR3+K27zs0k m X-Received: by 2002:a2e:9a86:0:b0:2d0:9902:16 with SMTP id p6-20020a2e9a86000000b002d099020016mr2914856lji.17.1707693358461; Sun, 11 Feb 2024 15:15:58 -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 et13-20020a056402378d00b0055d19c9daf2sm2170180edb.15.2024.02.11.15.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:15:57 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v4 26/35] percpu-rwsem.h: move declarations to percpu-rwsem_types.h Date: Mon, 12 Feb 2024 00:15:09 +0100 Message-Id: <20240211231518.349442-27-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240211231518.349442-1-max.kellermann@ionos.com> References: <20240211231518.349442-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: 1790646681501422503 X-GMAIL-MSGID: 1790646681501422503 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