From nobody Sun Oct 5 03:38:55 2025 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) (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 3F3F617333F; Sun, 10 Aug 2025 03:05:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754795116; cv=none; b=prEwnRdH04weMfPvISechXu4ws0adGTLeGkmpeDfs++bgzZbIuqTGTIIGXFQt6U6tssskJZbMVk9X/q/ur82iJKf5rBW3KaQ6OclRZ1u4wAFCMeri6eOzgaAx+HWTfVKg9JmOz9QJ3WVmCLPH8ZoUZtubsjoWpXXlx4OvrAwe8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754795116; c=relaxed/simple; bh=H3nbbMh6DFmUXspQhhndw/hL2Ne9GOlz0qBRkIv+PXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RfxouwXjKCeN2JMfABC6N9WOTuJBWbFns25IberWmQoWW1MT2UWTN+Zzgqtx67TtEjTT9wrXqp3n2Kns08vabqap8lmKFxbPikVCDgAWY+yzIcn1PN0Gm5fU8BNUc2fAMi4l09Q0IHCn2jU8LK4X/Ud283kYxo2C2uhASA8+zD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TOXvsoGK; arc=none smtp.client-ip=209.85.210.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TOXvsoGK" Received: by mail-pf1-f194.google.com with SMTP id d2e1a72fcca58-76a3818eb9bso3028022b3a.3; Sat, 09 Aug 2025 20:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754795113; x=1755399913; 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=yWBLnMnjRe/tJ9Xuvh/nd9/uV5uIZZike6HE1ZIhSY0=; b=TOXvsoGKUXvoMEF1Se2oYyKQ/RoeF84sYxbchkopUm6n+gRAuT+MXbLmC1Uh7MmTsg 8O8pTYibQTDSVfRJg0dLXxeM7oHkFYvfD4L+ii4iu8eMpk/vUKsD+XyZocbDkSLlE0vx lS51XHmPCOgEaF2CnZwv4RAPdT2PaLSIX20JderMaZCVONoM046DOK93fjYfdEppCVB6 gqF/VICwXCJC+fWepP4/5lX8Js3YHYLoH83Ssiy3gQv3SulFUiopu3L+SbLKQHErct5D UA5G433P5aiZVDDUKLXRRH2E63Z1qOSUmuY+LRG39c0AxkPgPl8EivQKYsm036UYc1E2 XiTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754795113; x=1755399913; 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=yWBLnMnjRe/tJ9Xuvh/nd9/uV5uIZZike6HE1ZIhSY0=; b=Py8B2ybbfz02gGIecXjimAfR4+z4ygoc32jdgoFb2o/PrproFzRybesDs7Ev2wiQlv 11A7mR7Awr9fC0cTCGst1V9orWdv9AkRKOCkVpxMQBwVLcp3AEf/oQFbQxq9zJLb2Nu1 IVe4h0t0BV1G6eRTOuv3QTybG6iQM/JNd1R9X1i7ktCYrX0Q/izRcoZYtB0X3FJ3Mghi esqtUkp/twmGdonVTstjbOB/XZDYUKLk1+zijM3DlrsI9a+uximO2o5hk0S2XZZ00eb0 wfsImbWtyjJ5HnjnXXFfi7qvXR3Zs8p1JeDUtSdl1uNGXBwPbiSIy1oYE4CqRIeypmX3 DMaQ== X-Forwarded-Encrypted: i=1; AJvYcCXDRqzuNjw2quvNwTYHvOM6vzuEmxUf1qVIOIzQbIFHB1zsZm/V9sxo73hZgGbZX1WiCk7de6njZh22UFOS@vger.kernel.org, AJvYcCXH3Irb4mENhibOXWIHWq5mQoskSD3v0ElkB/Nhbkc/gvj1XN4zxYMemxDho8pXoWszjIM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0xwHnPBWLxIu8kI9tj1D556Nf8r134OYaqIZ4k6NAM9x9/oF8 HUvZR+la2gqI2Hj9za4jGUx10QRTkMJaC4Xf2pTdSr6IVKv2muM4wsjo X-Gm-Gg: ASbGnct83sozKYYKIy5dAGyeFyUPwXePx15cn3gf3hkSPb8ts2C40YC0npJwrDoVy/Y +yDLi0S6x/XqQQOYJNBpiwyp8PoO0Ftr3s1HBxbMLHgjgPIlhApo6scIMI2YMx2f7FHCzD2Su8K 24R0qEkQ4Hdj2JHYfZCyLwtQ9rEEDxkHsqPJSVadtDAIwgdyHyRMQKDZMw7N0lGTLcn8dvG4pPu IyOOHfPq8AtLAY0nmXJ9/+h+qsQcWHuKvxvH0wB/5E/adRjkoHCB9GydTJhKDQJ24mc9Q4MVW8H sAZVTi+Xi6iQhaehypuFvON77q0duLVfV+8P/+EAiuuTHTCYFU1Le5TCZjKxrP0wbEb0L4Ci5Ah F8LhB1rGLBQnh6fU04RY= X-Google-Smtp-Source: AGHT+IGPsjlh3mP1XLBFKDqMLfi+dPJ1Y0XnOooP3TSnPusSI4JMCn2YU+ca1/gfFoRkF/3VO99q2Q== X-Received: by 2002:a05:6a00:812:b0:76a:986b:6d2 with SMTP id d2e1a72fcca58-76c4611cc70mr11848778b3a.11.1754795113228; Sat, 09 Aug 2025 20:05:13 -0700 (PDT) Received: from 7950hx ([43.129.244.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bdd2725c9sm21276265b3a.6.2025.08.09.20.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 20:05:12 -0700 (PDT) From: Menglong Dong X-Google-Original-From: Menglong Dong To: peterz@infradead.org, alexei.starovoitov@gmail.com Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, jani.nikula@intel.com, simona.vetter@ffwll.ch, tzimmermann@suse.de, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH tip 1/3] arch: add the macro COMPILE_OFFSETS to all the asm-offsets.c Date: Sun, 10 Aug 2025 11:04:40 +0800 Message-ID: <20250810030442.246974-2-dongml2@chinatelecom.cn> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250810030442.246974-1-dongml2@chinatelecom.cn> References: <20250810030442.246974-1-dongml2@chinatelecom.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The include/generated/asm-offsets.h is generated in Kbuild during compiling from arch/SRCARCH/kernel/asm-offsets.c. When we want to generate another similar offset header file, circular dependency can happen. For example, we want to generate a offset file include/generated/test.h, which is included in include/sched/sched.h. If we generate asm-offsets.h first, it will fail, as include/sched/sched.h is included in asm-offsets.c and include/generated/test.h doesn't exist; If we generate test.h first, it can't success neither, as include/generated/asm-offsets.h is included by it. In x86_64, the macro COMPILE_OFFSETS is used to avoid such circular dependency. We can generate asm-offsets.h first, and if the COMPILE_OFFSETS is defined, we don't include the "generated/test.h". And we define the macro COMPILE_OFFSETS for all the asm-offsets.c for this purpose. Signed-off-by: Menglong Dong --- arch/alpha/kernel/asm-offsets.c | 1 + arch/arc/kernel/asm-offsets.c | 1 + arch/arm/kernel/asm-offsets.c | 2 ++ arch/arm64/kernel/asm-offsets.c | 1 + arch/csky/kernel/asm-offsets.c | 1 + arch/hexagon/kernel/asm-offsets.c | 1 + arch/loongarch/kernel/asm-offsets.c | 2 ++ arch/m68k/kernel/asm-offsets.c | 1 + arch/microblaze/kernel/asm-offsets.c | 1 + arch/mips/kernel/asm-offsets.c | 2 ++ arch/nios2/kernel/asm-offsets.c | 1 + arch/openrisc/kernel/asm-offsets.c | 1 + arch/parisc/kernel/asm-offsets.c | 1 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/riscv/kernel/asm-offsets.c | 1 + arch/s390/kernel/asm-offsets.c | 1 + arch/sh/kernel/asm-offsets.c | 1 + arch/sparc/kernel/asm-offsets.c | 1 + arch/um/kernel/asm-offsets.c | 2 ++ arch/xtensa/kernel/asm-offsets.c | 1 + 20 files changed, 24 insertions(+) diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offset= s.c index e9dad60b147f..1ebb05890499 100644 --- a/arch/alpha/kernel/asm-offsets.c +++ b/arch/alpha/kernel/asm-offsets.c @@ -4,6 +4,7 @@ * This code generates raw asm output which is post-processed to extract * and format the required data. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/arc/kernel/asm-offsets.c b/arch/arc/kernel/asm-offsets.c index f77deb799175..2978da85fcb6 100644 --- a/arch/arc/kernel/asm-offsets.c +++ b/arch/arc/kernel/asm-offsets.c @@ -2,6 +2,7 @@ /* * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.c= om) */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 123f4a8ef446..2101938d27fc 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -7,6 +7,8 @@ * This code generates raw asm output which is post-processed to extract * and format the required data. */ +#define COMPILE_OFFSETS + #include #include #include diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offset= s.c index 30d4bbe68661..b6367ff3a49c 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -6,6 +6,7 @@ * 2001-2002 Keith Owens * Copyright (C) 2012 ARM Ltd. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/csky/kernel/asm-offsets.c b/arch/csky/kernel/asm-offsets.c index d1e903579473..5525c8e7e1d9 100644 --- a/arch/csky/kernel/asm-offsets.c +++ b/arch/csky/kernel/asm-offsets.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/hexagon/kernel/asm-offsets.c b/arch/hexagon/kernel/asm-of= fsets.c index 03a7063f9456..50eea9fa6f13 100644 --- a/arch/hexagon/kernel/asm-offsets.c +++ b/arch/hexagon/kernel/asm-offsets.c @@ -8,6 +8,7 @@ * * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/as= m-offsets.c index db1e4bb26b6a..3017c7157600 100644 --- a/arch/loongarch/kernel/asm-offsets.c +++ b/arch/loongarch/kernel/asm-offsets.c @@ -4,6 +4,8 @@ * * Copyright (C) 2020-2022 Loongson Technology Corporation Limited */ +#define COMPILE_OFFSETS + #include #include #include diff --git a/arch/m68k/kernel/asm-offsets.c b/arch/m68k/kernel/asm-offsets.c index 906d73230537..67a1990f9d74 100644 --- a/arch/m68k/kernel/asm-offsets.c +++ b/arch/m68k/kernel/asm-offsets.c @@ -9,6 +9,7 @@ * #defines from the assembly-language output. */ =20 +#define COMPILE_OFFSETS #define ASM_OFFSETS_C =20 #include diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/= asm-offsets.c index 104c3ac5f30c..b4b67d58e7f6 100644 --- a/arch/microblaze/kernel/asm-offsets.c +++ b/arch/microblaze/kernel/asm-offsets.c @@ -7,6 +7,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 1e29efcba46e..5debd9a3854a 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c @@ -9,6 +9,8 @@ * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com * Copyright (C) 2000 MIPS Technologies, Inc. */ +#define COMPILE_OFFSETS + #include #include #include diff --git a/arch/nios2/kernel/asm-offsets.c b/arch/nios2/kernel/asm-offset= s.c index e3d9b7b6fb48..88190b503ce5 100644 --- a/arch/nios2/kernel/asm-offsets.c +++ b/arch/nios2/kernel/asm-offsets.c @@ -2,6 +2,7 @@ /* * Copyright (C) 2011 Tobias Klauser */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/openrisc/kernel/asm-offsets.c b/arch/openrisc/kernel/asm-= offsets.c index 710651d5aaae..3cc826f2216b 100644 --- a/arch/openrisc/kernel/asm-offsets.c +++ b/arch/openrisc/kernel/asm-offsets.c @@ -18,6 +18,7 @@ * compile this file to assembler, and then extract the * #defines from the assembly-language output. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offs= ets.c index 757816a7bd4b..9abfe65492c6 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -13,6 +13,7 @@ * Copyright (C) 2002 Randolph Chung * Copyright (C) 2003 James Bottomley */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-of= fsets.c index b3048f6d3822..a4bc80b30410 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c @@ -8,6 +8,7 @@ * compile this file to assembler, and then extract the * #defines from the assembly-language output. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offset= s.c index 6e8c0d6feae9..7d42d3b8a32a 100644 --- a/arch/riscv/kernel/asm-offsets.c +++ b/arch/riscv/kernel/asm-offsets.c @@ -3,6 +3,7 @@ * Copyright (C) 2012 Regents of the University of California * Copyright (C) 2017 SiFive */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index 95ecad9c7d7d..a8915663e917 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c @@ -4,6 +4,7 @@ * This code generates raw asm output which is post-processed to extract * and format the required data. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/sh/kernel/asm-offsets.c b/arch/sh/kernel/asm-offsets.c index a0322e832845..429b6a763146 100644 --- a/arch/sh/kernel/asm-offsets.c +++ b/arch/sh/kernel/asm-offsets.c @@ -8,6 +8,7 @@ * compile this file to assembler, and then extract the * #defines from the assembly-language output. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/sparc/kernel/asm-offsets.c b/arch/sparc/kernel/asm-offset= s.c index 3d9b9855dce9..6e660bde48dd 100644 --- a/arch/sparc/kernel/asm-offsets.c +++ b/arch/sparc/kernel/asm-offsets.c @@ -10,6 +10,7 @@ * * On sparc, thread_info data is static and TI_XXX offsets are computed by= hand. */ +#define COMPILE_OFFSETS =20 #include #include diff --git a/arch/um/kernel/asm-offsets.c b/arch/um/kernel/asm-offsets.c index 1fb12235ab9c..a69873aa697f 100644 --- a/arch/um/kernel/asm-offsets.c +++ b/arch/um/kernel/asm-offsets.c @@ -1 +1,3 @@ +#define COMPILE_OFFSETS + #include diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offs= ets.c index da38de20ae59..cfbced95e944 100644 --- a/arch/xtensa/kernel/asm-offsets.c +++ b/arch/xtensa/kernel/asm-offsets.c @@ -11,6 +11,7 @@ * * Chris Zankel */ +#define COMPILE_OFFSETS =20 #include #include --=20 2.50.1 From nobody Sun Oct 5 03:38:55 2025 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) (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 1486917333F; Sun, 10 Aug 2025 03:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754795134; cv=none; b=iJdAeYdOdcSmbXPJpucCTBNgBH5I9NFALRvQEF9/thQ5fF3LljcIwirL0OUU2DI6X0dPyHEr8zDCBfnK+4Gk8de6sfBFq7HvxzvAlkillBTj2BUbOHiONIfUDeeDptGYxRGe6TWQ7iArvGUtBee7+rB1NeoRO1s0tGRntGZdcG4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754795134; c=relaxed/simple; bh=UW0pJQMcISAu1g75T7Lt8itEdsV5EjcUI+raQ8mCRCo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oQG/tpQjvTR5ppw2EMVofSptt2/r06EN96GO9IFMrBldtWqAmPnpLGwEHKT4BkuZcx6cXPmd10DDjoxGZI8vaI2CLU2SzxH6MLZISnVb9KgsZUctB0F+XNk03WSfQa46eIEr6s9dlQIP76Zhmo/4xInQw5FCFUwL5EQYwE6g3TU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W8hUDadd; arc=none smtp.client-ip=209.85.210.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W8hUDadd" Received: by mail-pf1-f195.google.com with SMTP id d2e1a72fcca58-76bd9d723bfso2929124b3a.1; Sat, 09 Aug 2025 20:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754795132; x=1755399932; 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=SfHV9bIyt5rbICyogwuiVIfKAoUEiKQorPCAB/q2Xeg=; b=W8hUDaddKxhHXGSOH2Rn/aBmNLLYiobZrSSXwhRygxiRsbLZIKkmHDdklFAseoi1f/ t4t+8ZbU6MkD19F8EjY61Tbuho5FsFOExUxGHJrhrylkd5jNvVN+MCfFLemaZbDTjuSw IW80zk8VBUampwiEI6/v/uLRD+kIoiSpxTvE42qrEZhEJ63a655jgqamWl8YfJ2D3wW/ 35j2N+uO6HMSf9hmHX6yEcr6qeYVmqlk8eNkshn8pk9TzIVzDWS3UbWuQ9/YKLdKtXq9 0maPhfgzrzfEQWb0EuflZW2f9pg0nVELme2HGq+movHUP9om5EOjKtPgNJVqbntJM0+R E3DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754795132; x=1755399932; 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=SfHV9bIyt5rbICyogwuiVIfKAoUEiKQorPCAB/q2Xeg=; b=MM8L5E+/XsJnI9LGca2JgWPgt+r21PrcvH1JaVFDR823JV58ksEHZl+laHCp9l749A 9OHKu9Y7NasKRSRifVLvXrPj2hj4RPuPd0lEjQeVfiHLTki8Wjv/ducwsmNEl9xEfoS6 hJGXlV/B7ppsHjx+Qvlmvyd0Eu7d3mLgbGkLbpPNTQhOpM2h9cC9tVwoxcUBKj0q1rWT Yizqxs7hwC2pWPt24NaoY4L6R9mCbBs6tb5TqhiDHgH9hT4UU2gJREa73LXzME319Dzb 3L/Pn1iCnYg2H68O696Sr098ZdkvCSnigWn3WyA0QyXpQ5fMyLS/gfzDLNz+jjcyzu6M AEAA== X-Forwarded-Encrypted: i=1; AJvYcCUBkpc9jWSFapIK9cAwiQs/RCWZpz/30wnywzz7dADiDgLXVtT7gPSM3QZ6bUAKezcKg/o=@vger.kernel.org, AJvYcCUifltZZmb5fgWRUZ2PJA8wU7zQhMT7YZbas9KePdUuBPx7OqOMN0E6xTTVs5/6vbnujtt5qiWRiluwiCDf@vger.kernel.org X-Gm-Message-State: AOJu0YynBI/PYs/mvJmcKDFtbxhwdXALzNcGMDxGkvISxnwmwAWsUdhw b4pA6VMdqxangyVQbj8hMVfC+D9x29v4+5QVcdNAvJOUws1xDeZnyuNu X-Gm-Gg: ASbGncvoo2UJ9cSAKUm25uJT81edX1gCgMhvLhsGi3aL62k7ftffHjN6q4uEJa111rk ZT2Xc2pHDzMR4050fDZ1Jn4jwarbKDFtXaKex2oULlyGqM+H5YBuTtwJ7pOTvaCif/AJylF5EfZ I2G70Iga8VaRytVIyye2nnDvm8pv5aPwEx+tZS9wN8WnRdIbUVAdE7MjQOtsBtEUhOXY15pnI0i z2Txb1DAvp9yFqBwof7obdAqeWGmPNrs7MP1w5cQvzYlaGbJYJ7Ggllizj8StieCFxJ7RkORBJi Kt+81I9K70/rEnHmFrKby+iBw7kepxLuiJmEW8nDUS3EHR9GkmtM8moXn3+olbD9Yv5Ol+8CcK3 LWoyuEsHWEnpLRs2YRrkbInCITdwrvQ== X-Google-Smtp-Source: AGHT+IF/XcaE8O/9dKzl5xPGfM7QV9bCDTJ5B7gD98tSc3MtNIZ3uwdw6StoAwey553JB7sC+sV72g== X-Received: by 2002:a05:6a00:10cf:b0:76b:cdce:484f with SMTP id d2e1a72fcca58-76c4603d30dmr14080885b3a.3.1754795132101; Sat, 09 Aug 2025 20:05:32 -0700 (PDT) Received: from 7950hx ([43.129.244.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bdd2725c9sm21276265b3a.6.2025.08.09.20.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 20:05:31 -0700 (PDT) From: Menglong Dong X-Google-Original-From: Menglong Dong To: peterz@infradead.org, alexei.starovoitov@gmail.com Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, jani.nikula@intel.com, simona.vetter@ffwll.ch, tzimmermann@suse.de, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH tip 2/3] sched: make migrate_enable/migrate_disable inline Date: Sun, 10 Aug 2025 11:04:41 +0800 Message-ID: <20250810030442.246974-3-dongml2@chinatelecom.cn> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250810030442.246974-1-dongml2@chinatelecom.cn> References: <20250810030442.246974-1-dongml2@chinatelecom.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable For now, migrate_enable and migrate_disable are global, which makes them become hotspots in some case. Take BPF for example, the function calling to migrate_enable and migrate_disable in BPF trampoline can introduce significant overhead, and following is the 'perf top' of FENTRY's benchmark (./tools/testing/selftests/bpf/bench trig-fentry): 54.63% bpf_prog_2dcccf652aac1793_bench_trigger_fentry [k] bpf_prog_2dcccf652aac1793_bench_trigger_fentry 10.43% [kernel] [k] migrate_enable 10.07% bpf_trampoline_6442517037 [k] bpf_trampoline_6442517037 8.06% [kernel] [k] __bpf_prog_exit_recur 4.11% libc.so.6 [.] syscall 2.15% [kernel] [k] entry_SYSCALL_64 1.48% [kernel] [k] memchr_inv 1.32% [kernel] [k] fput 1.16% [kernel] [k] _copy_to_user 0.73% [kernel] [k] bpf_prog_test_run_raw_tp So in this commit, we make migrate_enable/migrate_disable inline to obtain better performance. The struct rq is defined internally in kernel/sched/sched.h, and the field "nr_pinned" is accessed in migrate_enable/migrate_disable, which makes it hard to make them inline. Alexei Starovoitov suggests to generate the offset of "nr_pinned" in [1], so we can define the migrate_enable/migrate_disable in include/linux/sched.h and access "this_rq()->nr_pinned" with "(void *)this_rq() + RQ_nr_pinned". The offset of "nr_pinned" is generated in include/generated/rq-offsets.h by kernel/sched/rq-offsets.c. Generally speaking, we move the definition of migrate_enable and migrate_disable to include/linux/sched.h from kernel/sched/core.c. The calling to __set_cpus_allowed_ptr() is leaved in __migrate_enable(). The "struct rq" is not available in include/linux/sched.h, so we can't access the "runqueues" with this_cpu_ptr(), as the compilation will fail in this_cpu_ptr() -> raw_cpu_ptr() -> __verify_pcpu_ptr(): typeof((ptr) + 0) So we introduce the this_rq_raw() and access the runqueues with arch_raw_cpu_ptr() directly. Before this patch, the performance of BPF FENTRY is: fentry : 113.030 =C2=B1 0.149M/s fentry : 112.501 =C2=B1 0.187M/s fentry : 112.828 =C2=B1 0.267M/s fentry : 115.287 =C2=B1 0.241M/s After this patch, the performance of BPF FENTRY increases to: fentry : 143.644 =C2=B1 0.670M/s fentry : 149.764 =C2=B1 0.362M/s fentry : 149.642 =C2=B1 0.156M/s fentry : 145.263 =C2=B1 0.221M/s Link: https://lore.kernel.org/bpf/CAADnVQ+5sEDKHdsJY5ZsfGDO_1SEhhQWHrt2SMBG= 5SYyQ+jt7w@mail.gmail.com/ [1] Signed-off-by: Menglong Dong --- Kbuild | 13 ++++++- include/linux/preempt.h | 3 -- include/linux/sched.h | 72 +++++++++++++++++++++++++++++++++++++++ kernel/bpf/verifier.c | 3 +- kernel/sched/core.c | 56 +++--------------------------- kernel/sched/rq-offsets.c | 12 +++++++ 6 files changed, 101 insertions(+), 58 deletions(-) create mode 100644 kernel/sched/rq-offsets.c diff --git a/Kbuild b/Kbuild index f327ca86990c..13324b4bbe23 100644 --- a/Kbuild +++ b/Kbuild @@ -34,13 +34,24 @@ arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file)= $(bounds-file) $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE $(call filechk,offsets,__ASM_OFFSETS_H__) =20 +# Generate rq-offsets.h + +rq-offsets-file :=3D include/generated/rq-offsets.h + +targets +=3D kernel/sched/rq-offsets.s + +kernel/sched/rq-offsets.s: $(offsets-file) + +$(rq-offsets-file): kernel/sched/rq-offsets.s FORCE + $(call filechk,offsets,__RQ_OFFSETS_H__) + # Check for missing system calls =20 quiet_cmd_syscalls =3D CALL $< cmd_syscalls =3D $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_sysca= lls_flags) =20 PHONY +=3D missing-syscalls -missing-syscalls: scripts/checksyscalls.sh $(offsets-file) +missing-syscalls: scripts/checksyscalls.sh $(rq-offsets-file) $(call cmd,syscalls) =20 # Check the manual modification of atomic headers diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 1fad1c8a4c76..92237c319035 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -424,8 +424,6 @@ static inline void preempt_notifier_init(struct preempt= _notifier *notifier, * work-conserving schedulers. * */ -extern void migrate_disable(void); -extern void migrate_enable(void); =20 /** * preempt_disable_nested - Disable preemption inside a normally preempt d= isabled section @@ -471,7 +469,6 @@ static __always_inline void preempt_enable_nested(void) =20 DEFINE_LOCK_GUARD_0(preempt, preempt_disable(), preempt_enable()) DEFINE_LOCK_GUARD_0(preempt_notrace, preempt_disable_notrace(), preempt_en= able_notrace()) -DEFINE_LOCK_GUARD_0(migrate, migrate_disable(), migrate_enable()) =20 #ifdef CONFIG_PREEMPT_DYNAMIC =20 diff --git a/include/linux/sched.h b/include/linux/sched.h index 2b272382673d..be489558207f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -49,6 +49,9 @@ #include #include #include +#ifndef COMPILE_OFFSETS +#include +#endif =20 /* task_struct member predeclarations (sorted alphabetically): */ struct audit_context; @@ -2307,4 +2310,73 @@ static __always_inline void alloc_tag_restore(struct= alloc_tag *tag, struct allo #define alloc_tag_restore(_tag, _old) do {} while (0) #endif =20 +#if defined(CONFIG_SMP) && !defined(COMPILE_OFFSETS) + +extern void __migrate_enable(void); + +struct rq; +DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +#define this_rq_raw() arch_raw_cpu_ptr(&runqueues) + +static inline void migrate_enable(void) +{ + struct task_struct *p =3D current; + +#ifdef CONFIG_DEBUG_PREEMPT + /* + * Check both overflow from migrate_disable() and superfluous + * migrate_enable(). + */ + if (WARN_ON_ONCE((s16)p->migration_disabled <=3D 0)) + return; +#endif + + if (p->migration_disabled > 1) { + p->migration_disabled--; + return; + } + + /* + * Ensure stop_task runs either before or after this, and that + * __set_cpus_allowed_ptr(SCA_MIGRATE_ENABLE) doesn't schedule(). + */ + guard(preempt)(); + if (unlikely(p->cpus_ptr !=3D &p->cpus_mask)) + __migrate_enable(); + /* + * Mustn't clear migration_disabled() until cpus_ptr points back at the + * regular cpus_mask, otherwise things that race (eg. + * select_fallback_rq) get confused. + */ + barrier(); + p->migration_disabled =3D 0; + (*(unsigned int *)((void *)this_rq_raw() + RQ_nr_pinned))--; +} + +static inline void migrate_disable(void) +{ + struct task_struct *p =3D current; + + if (p->migration_disabled) { +#ifdef CONFIG_DEBUG_PREEMPT + /* + *Warn about overflow half-way through the range. + */ + WARN_ON_ONCE((s16)p->migration_disabled < 0); +#endif + p->migration_disabled++; + return; + } + + guard(preempt)(); + (*(unsigned int *)((void *)this_rq_raw() + RQ_nr_pinned))++; + p->migration_disabled =3D 1; +} +#else +static inline void migrate_disable(void) { } +static inline void migrate_enable(void) { } +#endif + +DEFINE_LOCK_GUARD_0(migrate, migrate_disable(), migrate_enable()) + #endif diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 0806295945e4..bfba29a4fb10 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -23853,8 +23853,7 @@ int bpf_check_attach_target(struct bpf_verifier_log= *log, BTF_SET_START(btf_id_deny) BTF_ID_UNUSED #ifdef CONFIG_SMP -BTF_ID(func, migrate_disable) -BTF_ID(func, migrate_enable) +BTF_ID(func, __migrate_enable) #endif #if !defined CONFIG_PREEMPT_RCU && !defined CONFIG_TINY_RCU BTF_ID(func, rcu_read_unlock_strict) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index be00629f0ba4..00383fed9f63 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -119,6 +119,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(sched_update_nr_running_tp= ); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_compute_energy_tp); =20 DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +EXPORT_SYMBOL_GPL(runqueues); =20 #ifdef CONFIG_SCHED_PROXY_EXEC DEFINE_STATIC_KEY_TRUE(__sched_proxy_exec); @@ -2381,28 +2382,7 @@ static void migrate_disable_switch(struct rq *rq, st= ruct task_struct *p) __do_set_cpus_allowed(p, &ac); } =20 -void migrate_disable(void) -{ - struct task_struct *p =3D current; - - if (p->migration_disabled) { -#ifdef CONFIG_DEBUG_PREEMPT - /* - *Warn about overflow half-way through the range. - */ - WARN_ON_ONCE((s16)p->migration_disabled < 0); -#endif - p->migration_disabled++; - return; - } - - guard(preempt)(); - this_rq()->nr_pinned++; - p->migration_disabled =3D 1; -} -EXPORT_SYMBOL_GPL(migrate_disable); - -void migrate_enable(void) +void __migrate_enable(void) { struct task_struct *p =3D current; struct affinity_context ac =3D { @@ -2410,37 +2390,9 @@ void migrate_enable(void) .flags =3D SCA_MIGRATE_ENABLE, }; =20 -#ifdef CONFIG_DEBUG_PREEMPT - /* - * Check both overflow from migrate_disable() and superfluous - * migrate_enable(). - */ - if (WARN_ON_ONCE((s16)p->migration_disabled <=3D 0)) - return; -#endif - - if (p->migration_disabled > 1) { - p->migration_disabled--; - return; - } - - /* - * Ensure stop_task runs either before or after this, and that - * __set_cpus_allowed_ptr(SCA_MIGRATE_ENABLE) doesn't schedule(). - */ - guard(preempt)(); - if (p->cpus_ptr !=3D &p->cpus_mask) - __set_cpus_allowed_ptr(p, &ac); - /* - * Mustn't clear migration_disabled() until cpus_ptr points back at the - * regular cpus_mask, otherwise things that race (eg. - * select_fallback_rq) get confused. - */ - barrier(); - p->migration_disabled =3D 0; - this_rq()->nr_pinned--; + __set_cpus_allowed_ptr(p, &ac); } -EXPORT_SYMBOL_GPL(migrate_enable); +EXPORT_SYMBOL_GPL(__migrate_enable); =20 static inline bool rq_has_pinned_tasks(struct rq *rq) { diff --git a/kernel/sched/rq-offsets.c b/kernel/sched/rq-offsets.c new file mode 100644 index 000000000000..a23747bbe25b --- /dev/null +++ b/kernel/sched/rq-offsets.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +#define COMPILE_OFFSETS +#include +#include +#include "sched.h" + +int main(void) +{ + DEFINE(RQ_nr_pinned, offsetof(struct rq, nr_pinned)); + + return 0; +} --=20 2.50.1 From nobody Sun Oct 5 03:38:55 2025 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) (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 0BFAE17333F; Sun, 10 Aug 2025 03:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754795150; cv=none; b=tmq/2pDoSR/NbuWfmDO8hheQeEbsaLhlr8x03eW+OlNUcQx4All0P+nbDNA7UlH79opiTEZUuEVjcJYsV8GDFCf+GMX229B4kHH7ND8u/1kTmjJi3EuVWoumYwxiiPH4h2MnkTMjnBtZsuzy3WLYktWAY/r0HFqDFbFhUGrzI8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754795150; c=relaxed/simple; bh=kVXO32XWFGFryq+9u4jMGw/2BQMQgJzRVyV+Y/D478Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QfNyBD0WsRuFRIhv3a8LWM0uAyYfw5ogyk05XSwmWnsVUJT5USv4lpt61hqAQgyFCGr5lBpHP07sY0zQRpD+xxRIb60YfsED/vQFimzGfvwYQk9x31ZiK57aaZAWdBUffdkm2Q5dYlSETEtpBA1Qb2P3L7DFExT6YeXrbWnEVKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=exYXhdii; arc=none smtp.client-ip=209.85.210.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="exYXhdii" Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-7698e914cd2so4385353b3a.3; Sat, 09 Aug 2025 20:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754795148; x=1755399948; 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=z/lWdjE3fEvYN7U+VU8qdCr2mZquMa68Yf5oLPz/zjM=; b=exYXhdii9sU3dH8OXIsCfC8jSw1z4/SZDe7d7ICOBLgKGe5D8XS7i79z+v9MqrQwPm 8+EqjvaVnv+qMtURWVYy4LpZMv+AkiSVTkVHeYVOjd5cU+c4edIClzLA3IQ+KK4EnYrK CCBG5QiC5948kCOq+22hgXXa+hfrUbyAFawpSn1C7O0+/2Tsq/94v0iMj8MRpCRuge+S I8naxgO+DTFab3bCFjsqCSILBOuCx5EIZq2rHpacJOdNaDSkp/n955nnUdE8RIiR52P8 O6Pxk1WSk7YmlQz23YefTaaag50TV3RkcaDP/1klNvVQTKq2kGLvszHCI7uMe1pA1iqO 5nuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754795148; x=1755399948; 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=z/lWdjE3fEvYN7U+VU8qdCr2mZquMa68Yf5oLPz/zjM=; b=V8oxCkJ6a+vq5tels9NC4KZcIfHMcM2qXsH2Fa9LhllmCMf8g/FYPGNg9MTBKT/Y0t /rjP/Aw8U79bBN0yJCNy3xS1k8Y+f5oXQCJ2W6K0ClX7ySfo5s+Na0z+d2t/Kz3qRZpc qkWfcy+G6IwlJJ6M09MujHhl2V0Cr3Qs4C2xpCMGX4xqS9U283dnQMIBovgiuslaGGoJ PZnT4rKT26jaydM51feybdJkVvIVoMQwie4ivAIu3Iwt8fi3ea6Vl+obHiR3a4mjmjBx H17+e9ZKSpdAt9TSJIwUTNVnefoWPZnPtGrLhFmamvSo/KlC0oXUpky3oRQgQhNc1ooo hixw== X-Forwarded-Encrypted: i=1; AJvYcCUgEDxS5n+kYrlTjfi7WGNiIZsCX+lgPPgAlVdX6fHB+QSQNWx0/uVJ6Sbv58uKENErJG0=@vger.kernel.org, AJvYcCVSWvG/1e1kkLxLSiJcWh0k+lQE4bEQ9Id7bO9C81/gw8tIoDM8e8wbNSzvOZSZASYgLQjDVW7qKBTegDNS@vger.kernel.org X-Gm-Message-State: AOJu0YwLdkkzRxRUiIwGNI4fO7JbRefURS02qg+T+FERtxwtH7JBc978 52xF/ZcCzwy9chPtLrIb3/+/mmSic8xg+ujdR46zRkQpoIrutSq7aimc X-Gm-Gg: ASbGnctef11rl2s/MpAeWlB/i3HcW+NN9D16wDpb2D+sAuxaDIdydwNM7A9w53QBZ91 xkWDakumvCtEN4PzHJWD9N2kG18sWCr03fwJxKBIGAJKGpYmiDGpwTRbNZobKXkSrbT2yaNbPiI 6ZdIHKR83TUXrWFXqiGSjS7k2iNXz26mIEf5skRk/mZ4tnZP8pEAs7HosHVaoIyuh+ExILnU3LV HRceCsN8kCbPnDXSvXY6Htx3//07aVUpHOlA2nEQNmlmK1CrRidsXzsF2nfOlIKAcrfSIRXRroL Me1SfGycHtqoROKktoOD/1zu7j0CRjUaPaaZkv/cFn9j5tUb0lc0HpzkznyFHrjalmD9nY7HEDL 41tulaClU8QDWSNAuNa8= X-Google-Smtp-Source: AGHT+IGpQgcJ07Rb0COrFVRfwZ1+k4jjANaMerJrGc10MFgaKDK94feNSeCO72ZP1Id+CGk4jqhMnw== X-Received: by 2002:a05:6a00:2d14:b0:76b:caa2:5bd8 with SMTP id d2e1a72fcca58-76c4617fc32mr12233675b3a.13.1754795148132; Sat, 09 Aug 2025 20:05:48 -0700 (PDT) Received: from 7950hx ([43.129.244.20]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bdd2725c9sm21276265b3a.6.2025.08.09.20.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Aug 2025 20:05:47 -0700 (PDT) From: Menglong Dong X-Google-Original-From: Menglong Dong To: peterz@infradead.org, alexei.starovoitov@gmail.com Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, ast@kernel.org, daniel@iogearbox.net, john.fastabend@gmail.com, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, jani.nikula@intel.com, simona.vetter@ffwll.ch, tzimmermann@suse.de, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH tip 3/3] sched: fix some typos in include/linux/preempt.h Date: Sun, 10 Aug 2025 11:04:42 +0800 Message-ID: <20250810030442.246974-4-dongml2@chinatelecom.cn> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250810030442.246974-1-dongml2@chinatelecom.cn> References: <20250810030442.246974-1-dongml2@chinatelecom.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are some typos in the comments of migrate in include/linux/preempt.h: elegible -> eligible it's -> its migirate_disable -> migrate_disable abritrary -> arbitrary Just fix them. Signed-off-by: Menglong Dong --- include/linux/preempt.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 92237c319035..102202185d7a 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -372,7 +372,7 @@ static inline void preempt_notifier_init(struct preempt= _notifier *notifier, /* * Migrate-Disable and why it is undesired. * - * When a preempted task becomes elegible to run under the ideal model (IO= W it + * When a preempted task becomes eligible to run under the ideal model (IO= W it * becomes one of the M highest priority tasks), it might still have to wa= it * for the preemptee's migrate_disable() section to complete. Thereby suff= ering * a reduction in bandwidth in the exact duration of the migrate_disable() @@ -387,7 +387,7 @@ static inline void preempt_notifier_init(struct preempt= _notifier *notifier, * - a lower priority tasks; which under preempt_disable() could've instan= tly * migrated away when another CPU becomes available, is now constrained * by the ability to push the higher priority task away, which might its= elf be - * in a migrate_disable() section, reducing it's available bandwidth. + * in a migrate_disable() section, reducing its available bandwidth. * * IOW it trades latency / moves the interference term, but it stays in the * system, and as long as it remains unbounded, the system is not fully @@ -399,7 +399,7 @@ static inline void preempt_notifier_init(struct preempt= _notifier *notifier, * PREEMPT_RT breaks a number of assumptions traditionally held. By forcin= g a * number of primitives into becoming preemptible, they would also allow * migration. This turns out to break a bunch of per-cpu usage. To this en= d, - * all these primitives employ migirate_disable() to restore this implicit + * all these primitives employ migrate_disable() to restore this implicit * assumption. * * This is a 'temporary' work-around at best. The correct solution is gett= ing @@ -407,7 +407,7 @@ static inline void preempt_notifier_init(struct preempt= _notifier *notifier, * per-cpu locking or short preempt-disable regions. * * The end goal must be to get rid of migrate_disable(), alternatively we = need - * a schedulability theory that does not depend on abritrary migration. + * a schedulability theory that does not depend on arbitrary migration. * * * Notes on the implementation. --=20 2.50.1