From patchwork Fri Feb 9 16:40:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 199026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp997872dyd; Fri, 9 Feb 2024 09:11:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGBrBgOncxfarPh51NcOt+sZP4CtjLCev6UsxGDLkNQ7y8DCFQMCLC0iAjO6JVFRb1/SaG X-Received: by 2002:a2e:a7d4:0:b0:2d0:9b1c:649e with SMTP id x20-20020a2ea7d4000000b002d09b1c649emr2278113ljp.31.1707498704895; Fri, 09 Feb 2024 09:11:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707498704; cv=pass; d=google.com; s=arc-20160816; b=FevHLFZ5YolWf+DJUq2CIF/ak4luwpmXdabcwrY2kDKdBiICl7pqsT90pc1s2l+8dj bmpwIP+Wk/go6XVu3kJgKHN83jThbEcfQb2ZCvhLp457LaJn+3OW3LbRfeSfQI9LDpsg aoJaMm+V2Qk6JPu30OSabnZRxrU4bVC49RwPBNK+V5/oCYGfiFY6WV2y7+UszAkdcq0R NXgigDOlszVWSzfatQQ3ML+9jD++i+E9PPUbLxzo0nzhiMugWKntzalCnyemGZWXcA2J icNTC0YZbHcfBFP7puU+Y05asccrVbXOd8RSzALmzpOyRuLVqb5C80hL8wN2cOwH2okG jfOw== 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=bNWaDKNgAvPJPj5aHOXXkRaWKmKo1JE7tMxGNCLD2uQ=; b=tZnowd3Bzx12RKwHHAR93qv82//hshk7FyQ9KZt5FbrRSC4OmurhDbRDUnokAUaXMh Jq31Ftc0Cp7RAJA9gtKiL4IM5mEUx3S5ZGJvSnQ5FaRVQ1tFG1I/7UPPAou+2BXQOXJt wRpqfYNTQDWFJ1g2OdCjHDmcfPPg3fbbbaiBXb6G1xt4UHCaAKOaKelnv3F/Wj3QNpIv TsOXdKM4pHkL0jLtL963gMgOwgE5gBH7gfxqpxDxVLCAJDOMcP2vKOznWP6NUzi9AITu reSGT2SdqV37bFvG5MFxNgBbztG+kYaAqzJa7E8PrihGT2bAj7KF9MVHU60l19ut15NI 1myg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=a5oW3mpC; 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-59645-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59645-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCX/ONq+lGuZzG60NlhHv9x5VYemIgzS4OMi18qf1DKCgfd7nKz+oH6Hl+7IPw2Vtut3JniqUB+zF9rTIMbRDXetB3+dxA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t22-20020a50ab56000000b005612701a91dsi999169edc.91.2024.02.09.09.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 09:11:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59645-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=a5oW3mpC; 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-59645-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59645-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 69E741F221B3 for ; Fri, 9 Feb 2024 16:46:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC8C312BEBC; Fri, 9 Feb 2024 16:41:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="a5oW3mpC" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 D8D9D1272B9 for ; Fri, 9 Feb 2024 16:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707496876; cv=none; b=Y5aVLAPTSWt5v8pm3azfkWLM9SDiOVGtQQ+jQOt1wBjadaCwmyhHJfPWSVXwEtKMwaRWTOiNubNVgxYUwhcF6WZmHZOH/OidhUmzan+Z0Mdh93VA9iAHr2xH30ATuJDBE94NkWCTUHdPRwjIpsf8aceiGsnerVfg/MHmW4pzryA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707496876; c=relaxed/simple; bh=k0CWYvaaB/gYg4+a4TXJ9LeyRASwAqQNiIxSmINjJE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gOcjr/SRTPe7m0AJuo0kxgeEssuVIkORD59Ub+VD3cOWMtBVzlh13HPERtU3E6WWEiM0l8wNFbXgUoHF4B4bZGz90sPCYf1ChA9cpsNTuN+0IJr5sDELw/4GC3UnWqjjzacxudJzkHl4SskOq53VZyfZ1Y+MRUtEHiHGraLjN/o= 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=a5oW3mpC; arc=none smtp.client-ip=209.85.218.52 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-f52.google.com with SMTP id a640c23a62f3a-a389a3b9601so157284166b.1 for ; Fri, 09 Feb 2024 08:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707496870; x=1708101670; 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=a5oW3mpCkM7ItOQw+WfzUoAMLD6XUFDf/dSW8+yi2nRq5y3r+GOOXVtjlIvt9getoO /zfySyTG+JNiswEU5/f0d6/92QSE0GP5LuuomaAXm8QSwtzWJYLfEl9uPiSn05pDKWi5 0K90MZMPySe27eey4hnaAJ1cmrTBgnBN5N1fRStcfNDt3Mlra01g/oTl2ALBNnP/nu4V uzwL03INSxZrn1kYRUXOZ+PtoSrOB+HjIEDzZDFIJLNF9aZKASYL+YLk2eo8DINtNIip j4rG7nVJmH8R1H5xnUwVnBhHR7XB4+2qS6Y82MdzgKUIimDnUYJsm0wdGIrskLZ9u3JC cyKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707496870; x=1708101670; 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=mJSeUcb9m4AnJftA3/NtgTZvoitiZbYpdvgxSbLZLdHE//wOeHdB+pZKz11jVn/IfV sdGF8TPfmNmMO4++OesZr16mz1redGTty88Ges3MU0VePR9G+ZUxwfBCd+l8QVJA4PYt NcqwVyHlryiKKWmhGR+/B4COtzkrR+aXpjACJmVCrWt400qDXNUfVh/9Gdo4KlSTZtIl xSqBH4+0CzyakBNO08y67iZCIlZDU88uglvrZLknh+Al1B8SzUFe0elGzBdIYjt6v2w6 gsGwwGQTv959So3pqzTnS5DPpmUXYgokNK54k5tCyey/I1HtP3NH+A59As/GH1tPpwjP klRA== X-Gm-Message-State: AOJu0YxUI7CzRN1SJxWuPbFsCGLgEFCLsGgToCokV2zVTRqHuPu9jJ17 b8zkqjHNqEBdgK2qRaUzyitDQEA1MqrUcex0C+Ow8ZNl5CPUQj1RNaLf912Y9a3J5lgxCBdW1Nl 5 X-Received: by 2002:a17:907:f84:b0:a3b:c959:24e8 with SMTP id kb4-20020a1709070f8400b00a3bc95924e8mr1650347ejc.5.1707496870708; Fri, 09 Feb 2024 08:41:10 -0800 (PST) Received: from raven.intern.cm-ag (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id tl27-20020a170907c31b00b00a3bfe97fe27sm477724ejc.218.2024.02.09.08.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 08:41:10 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v2 26/35] percpu-rwsem.h: move declarations to percpu-rwsem_types.h Date: Fri, 9 Feb 2024 17:40:18 +0100 Message-Id: <20240209164027.2582906-27-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209164027.2582906-1-max.kellermann@ionos.com> References: <20240209164027.2582906-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: 1790442161869273291 X-GMAIL-MSGID: 1790442161869273291 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