From patchwork Tue May 30 18:11:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 99942 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1237281vqr; Sun, 28 May 2023 19:24:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eUIoZkqR0nvCo6oFZ3ZXoAITqiuVu/DUoQ3QzpRlUUsLT2O+6UQY0LdN2RfHUSWWUpAJP X-Received: by 2002:a05:6a20:54a2:b0:10b:dca5:74e5 with SMTP id i34-20020a056a2054a200b0010bdca574e5mr8051829pzk.0.1685327044176; Sun, 28 May 2023 19:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685327044; cv=none; d=google.com; s=arc-20160816; b=m41qUwZi0sB5ctejIF2K49mUK8NE7wOJpasgeSEHIvbJEK1boISI56ciAIMNUGHcTA DemSKntNzJMFdRAA+2kLGCyUf4JEE+/On1PzAdXju2E7s5ovnJuBPVkAi6JWOBUg1WBJ 7qls4NBOHgLSVCV8YG0C20cA8GoyWqPIxAW40O2roUaBrVVgPL4MiEY4r2DlCM+QcgWm njItER44a0JsfTTcS/hCpikz4gZhm6nuSOQ/hiYJqD+ljRM7bUjI/8eg87hd2nqd3giF 4QSq5LwbppsGNePqpcusFYqKnwENnWrWaBqCDQq8vYlhklELzI9kOg7x25aWkef6z+Uw nZKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=pp1YoZegR0z2NcsRk14G7n33O7rs5YDVxI/2hIsfzAI=; b=YdaPF0puUvOblpbcEes9bRMIEeZuMBKT9pBV2kKnheuwCPZhxEzYGs2bE3sbRbzdHF 94z0uya+uyIQHHaU5q2U+kwZqf+Zy/LKEIpsDUCwISnltaOMMeWBrsF8r1fMbs+XLjni 1CgEemhz/Z9c7BsUQgf/xGxOkkXztP6+iIhO0udAkXhLkO+EN8vZubJgkkRu8xwYge50 SO8rmS3tDGAYqpFoFevfiHoYi2tCO1TVSWLBkL3PHfyZVMZIfXZQ3VogemYl7mLWHfdF /+JPchgt/wI1/N3t8kTSopCrSxubhSmibeO+JvsDUulUmMiKK5G6TUiIl7gU4WJVvnyf Fzzw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i64-20020a638743000000b00513a68ca71asi8668539pge.742.2023.05.28.19.23.52; Sun, 28 May 2023 19:24:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229523AbjE2Bky (ORCPT + 99 others); Sun, 28 May 2023 21:40:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjE2Bkw (ORCPT ); Sun, 28 May 2023 21:40:52 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8DDABC7 for ; Sun, 28 May 2023 18:40:47 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0946018011D6BC; Mon, 29 May 2023 09:40:25 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task() Date: Wed, 31 May 2023 02:11:45 +0800 Message-Id: <20230530181145.2880-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767193491044315096?= X-GMAIL-MSGID: =?utf-8?q?1767193491044315096?= Using the while statement instead of the if and goto statements is more concise and efficient. Signed-off-by: Li kunyu Reviewed-by: Mukesh Ojha --- kernel/sched/deadline.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index d823e608c7f0..b94a498f8cd9 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2112,15 +2112,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu next_node = rb_first_cached(&rq->dl.pushable_dl_tasks_root); -next_node: - if (next_node) { + while (next_node) { p = __node_2_pdl(next_node); if (pick_dl_task(rq, p, cpu)) return p; next_node = rb_next(next_node); - goto next_node; } return NULL;