From patchwork Sun Feb 11 12:29: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: 199428 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1903743dyd; Sun, 11 Feb 2024 04:37:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IErRLMdDVKwqrY5Xq6wuy+UuWYowMnRaxb/70jDm9DiYzBCyTzF3FS/wn5bFQ/4WgYIH+c8 X-Received: by 2002:a0c:d984:0:b0:68c:c7f4:8178 with SMTP id y4-20020a0cd984000000b0068cc7f48178mr4314283qvj.57.1707655049486; Sun, 11 Feb 2024 04:37:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707655049; cv=pass; d=google.com; s=arc-20160816; b=jNpHZQioWRiD/GpQhTO/gw3X+vKYhV5jzbXeU2Ls2AGdbG5/kfcCHphyB8dJ8/+Kk7 YDVkAFVKgMhe/kZiwSsDspZj/5BS3gIZL4mzAWmVmfPUJeAmEyikUtghDA2WewvO4QZq L3LfhzYiGc8ssYAWiVbc6oZtZsOrkein5eWI4RzQDI//zcDKOMkVPTXkdzU+XWTcJfJf 9n7XvhjkPm0eQ3xQ9VeQMLmp9lnEPNypg4cQnDjxzgNY2O6bRUyYYRK3PUcQbVP/gInY OgzUMJSuCwrNM5ZsFgo0YOkqV/39aClAG0AYSiphsiAsBHUBNATqDgLsVn854Eb/Sfmf 3enQ== 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=2zxTBbWOOzf1rUkPnxZguQn4Gq97G0UdcbmYgoTn4LA=; b=GPMOlJrpRAmoNwOT5t/Ot+SgTD6BdYwemN6YyaH7xqUmO2dBscJi6fYWvy3RJ1RXAG q9c2xI6CaGJaRvQBmR/iEQabfE46EDfROPQIzpgoVcQ3nFvJSxf0I+nW9DuzAhzMxw7Y pAao9du5dRYbcl9J31safAnDG/yu2hqpyRF8rYMUdPPWfhjqeDaNWkHgU9XZiog7qYzK 1fQ0T6v2LAbZJ9/aPoG4faG+Tl8hjLiVuchra41Cc7frnDIzT2QVsalazRxAbT4bm1vI PQ/3c/gQgRIiT7VgJALWjcCllw2rWCxfGByFxJls6LP8RhW+nTRkW1vEW16djIpl1mpu CZQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=f6ZYB5xE; 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-60755-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60755-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCXdtWAEmPyNP+td03MpB3APYsfEh9wkJ2U+htSS6pwtCUnMyIj+LhQdcCOOjSZo5Wvd5DBmXyAgNc3Ok/dznUA0Z5yLAA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f2-20020a056214076200b0068c8ab72bc7si6153493qvz.112.2024.02.11.04.37.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:37:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60755-ouuuleilei=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; dkim=pass header.i=@ionos.com header.s=google header.b=f6ZYB5xE; 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-60755-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60755-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 482A61C20DD5 for ; Sun, 11 Feb 2024 12:37:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AFAA60907; Sun, 11 Feb 2024 12:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="f6ZYB5xE" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 0622A5F49E for ; Sun, 11 Feb 2024 12:30:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654646; cv=none; b=kz5vHA3w3kbBt7CpqSwVLto+Dpj/KDtFGK27TGbKKzcuq3g7LacgXGvGcE4+Pq8VU7VWWq4Kiy8o4VT8Kefh3wGUTPNR5ANiJQckkQOFLiJKocWPyzdGSVwAfhAr30RdGavVK157LWEq4xFMS3wZ3SWFjJKbFDNA4s4yN3pXazE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654646; c=relaxed/simple; bh=k0CWYvaaB/gYg4+a4TXJ9LeyRASwAqQNiIxSmINjJE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kSM6d0JV/n2Iyz97Ou2NlyWDuQ1KCwzZM8LevKNkptrZxc083mtE1XTZoiwi1pkaK8YlzE/dKg3weUMRYh731Y/FKQwttdvjK0G7hru8F/GOJ2BKboDrpF8LeI7PEOW8UO9aVGuchrJpJAoNu+2u6stbToc28ePTd6aLoK/K/Ns= 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=f6ZYB5xE; arc=none smtp.client-ip=209.85.208.53 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-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5610cc8cc1aso2398749a12.1 for ; Sun, 11 Feb 2024 04:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707654640; x=1708259440; 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=f6ZYB5xE0VNf0k0hJMmX/jaIUNR7+6Lvo6P8SZ9aveFmBRpsOubfcyO216wwh+zvk0 DjPcM6Ev0r7pkyoxR40Rfm3dG5u+ZCuxByNP+LhLKrxhFiVz8IvZQsKIAkn/VBvoWgzM blVGAjGXaOlPQOU7T9btTKRQmxfY6QR3GeXDR7LcZFsP87/ibinjzMW6N8+kBO6CkHDR 9HXQvW6IlST5edxuodGSb76gGhKFxZuA1jwUlZhL20GvzD18tWfiT0VwkIbE/OKyHUru 5QMF/hWu8xRRvnJ5dXobr6/ggoFgTKG+Tx1QHAEQr0bN+Di3JwSp3MFkIacsIs/1U191 WeUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707654640; x=1708259440; 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=LZdyFFIVu6OQcAeC+nbdfUZw7YW1LGVHmmRFgJHq2USnO/qzprY8opF59McN0zNDcs GjS0G1Cr+6S9CMb2BSQA+TaJXPE63AKbkQO3H6AS+QEJCJv4rwbwldXTVSf9jNaQzeo/ Z3kq6SJmx8IFaVBvi2TuOw9+cDczkWRwWeBd5qOUw+WS0c3JmqsTmLpmMIS4+4XAVjKK tKtfWj62sfuFPvXKQ/AxufVFLihfG5Y+1ZPQ2JAs3ByzJlOvOTH/aiLYMorNea+VCUZh lHadddzcDpiHZl0kaoFoCen0vzQM6Qmc3PLhY6Ez17xMfYGWAAoRORRAtgpRByBXOKEP kyKg== X-Gm-Message-State: AOJu0YyArOLhkMflyoOwUNlTRKZLHX3GnaixNfoAk+KFHTlW9MO8ZMhb lhyJ0WbafTOa81Ml8h/cVsBRi0jeJaeTDWBF/ov6qi5rMxrBmM5ruudXFXC9kDypcChy2bz4qD0 b X-Received: by 2002:a05:6402:128e:b0:561:2f3b:7221 with SMTP id w14-20020a056402128e00b005612f3b7221mr2438701edv.18.1707654640647; Sun, 11 Feb 2024 04:30:40 -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 fj18-20020a0564022b9200b0056187ca4120sm1024611edb.10.2024.02.11.04.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:30:40 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v3 26/35] percpu-rwsem.h: move declarations to percpu-rwsem_types.h Date: Sun, 11 Feb 2024 13:29:51 +0100 Message-Id: <20240211123000.3359365-27-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240211123000.3359365-1-max.kellermann@ionos.com> References: <20240211123000.3359365-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: 1790606101011434793 X-GMAIL-MSGID: 1790606101011434793 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