Message ID | 169202568709.27769.1200732913266854235.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2830250vqi; Mon, 14 Aug 2023 08:46:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFd5mgzmSza8icAeHeVmAkLLJV8SPvMyfxyEYf3aybOr2PsBUs2B+wojHvzpSiqrpiLPp4Z X-Received: by 2002:a17:90a:c901:b0:267:f9c4:c0a8 with SMTP id v1-20020a17090ac90100b00267f9c4c0a8mr6354201pjt.4.1692027978832; Mon, 14 Aug 2023 08:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692027978; cv=none; d=google.com; s=arc-20160816; b=VH3GJNkr6mB+5u8CAfhLwV44N4Whn/RLsJ7ILj4xo7oNMX4AWfN7354Mu8XBNDstxC JwOFU+YJi4tv1fRoy/rOXURbKdaeIwe5aAs3vQiYfXJvrRB+v4Jm3nn6XgmiJnw1DNX2 n8NG4MJdDlfCRhht/KCN8zNRQ5sShS4Zwr3Gd5zIowcTIpUpsTT9izelCvix4p0UIwk9 j9R8SIu2KIRXSfLClO6uz4bYcB4AvM6fK8aT83JG0PsLh39cUvUQXiDSzCJYYvinSt32 qgH6pgKoVVXUck+LGyzHesBbAvxjPDrN1Ov5T82yzyK++geYl3bsWDWCb9ize/mPG9ZY PfTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=TtHT+J68I3rRJzRfHqk10FJonfgbAJ03Mdzrif1b1mU=; fh=9BR/gsEAh/fSRAkzJ8jNxrANsAm8CeI+OnvVk4287ZY=; b=As/29tSrAxcLt730Lg+wgVgmdXtsGGW1+oCvWOPK+GqwLo4xkwGWp5aHKxK6yxb9ws UcMw6AD+gA+kyELakKKRhdcDPHb6N0pdAmjZisvLbUFgr4L+Bo3j3Xrbd1g86vsV7Hb0 zUuuMDd15lNQ3KD3Sgh9hfZ+fUsVpm6nxO48lP1vzG9DsNRbPF+qiqz+5LdhTK73uun7 RQsIk/zuqAVL1q/+RJhh6OJwWu0bivjweZvEQsR7SZvdm4Gk9EQU74xAGtwGWVPkIIl2 ep2JLMTSrSGk1osLxPZ2c7XW18n1Q9jrt+orX7MSjW8mC9vaDiS4nU1+746eYO0FEBWG 4zrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BltpUni2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=rhCZn1Q3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz11-20020a17090b0ecb00b0026b527a96f0si2411414pjb.129.2023.08.14.08.45.47; Mon, 14 Aug 2023 08:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BltpUni2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=rhCZn1Q3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232699AbjHNPId (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Mon, 14 Aug 2023 11:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232681AbjHNPIN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Aug 2023 11:08:13 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EDAA1701; Mon, 14 Aug 2023 08:08:09 -0700 (PDT) Date: Mon, 14 Aug 2023 15:08:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692025687; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TtHT+J68I3rRJzRfHqk10FJonfgbAJ03Mdzrif1b1mU=; b=BltpUni2c9NXtlxUmSn/rU5QLNmNCkCQ+95EzRLKLBxLZqXGR0nO+j/Vt89bgi/KAiAGeI ReCncP2ZJtf5FySBPFmEgwYibwR7QKpFtdnqXHWS31ViJY5Lz7Pu2mTU6XHW51VJ8K7R7k sAAMqxlvmxl/iHWyuMi+MFyWFHYub1rSUtHYp3OoXMA960h02wIMMbQoIAKbXHP+oaVtzT t8j9wJY97xobW0YcTO2909r13XrERwfZRYCOZiae/9TFiVpdufDSVUIqST2Dhe+CoID0jN zNcO+qGgkUXkHAEM6rR9pP5o+2I3p2tSIMWhQyWfAlJ10NGE8JUen7oc1gTaTg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692025687; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TtHT+J68I3rRJzRfHqk10FJonfgbAJ03Mdzrif1b1mU=; b=rhCZn1Q39812hLfPld+vRtxYLmkpjGjuEyVfm5EogcT5fYUR1sxSLgyJl/YfIFFcOivAR2 0N71+Jcf71J5h4DQ== From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Simplify get_nohz_timer_target() Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>, "Joel Fernandes (Google)" <joel@joelfernandes.org>, Valentin Schneider <vschneid@redhat.com>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230801211811.828443100@infradead.org> References: <20230801211811.828443100@infradead.org> MIME-Version: 1.0 Message-ID: <169202568709.27769.1200732913266854235.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773065437466724073 X-GMAIL-MSGID: 1774219929999002849 |
Series |
[tip:,sched/core] sched: Simplify get_nohz_timer_target()
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Aug. 14, 2023, 3:08 p.m. UTC
The following commit has been merged into the sched/core branch of tip: Commit-ID: 7537b90c0036759e0b1b43dfbc6224dc5e900b13 Gitweb: https://git.kernel.org/tip/7537b90c0036759e0b1b43dfbc6224dc5e900b13 Author: Peter Zijlstra <peterz@infradead.org> AuthorDate: Tue, 01 Aug 2023 22:41:22 +02:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Mon, 14 Aug 2023 17:01:24 +02:00 sched: Simplify get_nohz_timer_target() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Reviewed-by: Valentin Schneider <vschneid@redhat.com> Link: https://lore.kernel.org/r/20230801211811.828443100@infradead.org --- kernel/sched/core.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a97eab3..6cda296 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1097,25 +1097,22 @@ int get_nohz_timer_target(void) hk_mask = housekeeping_cpumask(HK_TYPE_TIMER); - rcu_read_lock(); + guard(rcu)(); + for_each_domain(cpu, sd) { for_each_cpu_and(i, sched_domain_span(sd), hk_mask) { if (cpu == i) continue; - if (!idle_cpu(i)) { - cpu = i; - goto unlock; - } + if (!idle_cpu(i)) + return i; } } if (default_cpu == -1) default_cpu = housekeeping_any_cpu(HK_TYPE_TIMER); - cpu = default_cpu; -unlock: - rcu_read_unlock(); - return cpu; + + return default_cpu; } /*