Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2265859rdb; Mon, 9 Oct 2023 20:26:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGSx7cFoHNpW92qhlUAe8nrggc82izfG4XmL595XHU8Hz1tter8MHoLDMkJw6vi2JVuuAz X-Received: by 2002:a05:6a20:9185:b0:163:9f1d:b464 with SMTP id v5-20020a056a20918500b001639f1db464mr17159514pzd.5.1696908411966; Mon, 09 Oct 2023 20:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696908411; cv=none; d=google.com; s=arc-20160816; b=qPmd4y4h4Pxx/96CycBcD2udbj7p5RJw5NqYL6H6P74WgQAIdmP+rmXJtXUFJaqBWD zwR52kOZEV5Vt8Dua2lLrdBYeVNtFgXG7TauF3tH9gg+cCE/fedt0CmpGb5wM9/D/go1 LRLirt1ekWf/p8mM8ro78g7/ytsjvfuf8+7kx8lYnWl1dmagV3PZYwdfV+9yZ1TjtXLW tWqPj8O/pwcGAnElKgg4eMSgmuzsKV8soyfQarEBC+F/iioxaB8fbF6Lw0B9HH5bWird Wmkf3o9/ndLrsGJGsg5GpkYGjw4J6I7jhH3VavlpXyD3na0vvXsckrHDBA3i4hbi2lxx ZJag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MkgRleqJn8Rb8Tnfmxr6CkU++lyf20kEdvt3QKIbdqQ=; fh=MLr4JXf+L5yRqga5fEvrJ/3WJxPS+JygCIY+5v5DUo4=; b=u2ByPeOQ9es+d4qZQzcunNLNwoMZrXTQZq/3Q6tYLboguPL8Dj4bqT28MHUjbMSDyc GqAXjX+IpnocTXMmjWyzbMYZTgRI2z0OUjn/dsnC+xzfIKw6a1WfG7tzbBUYxth/7i2M ipwlr96jCmsQfpwGwnZo/Q/VJlFteya1U38RNYauU+/BV7fI/akm9QDatN7Vh8F068q+ 9EIpTPSo7ZUZQDFsbM+bqK/6mdw+qRZW39jYQrOLGxCL0RWfm/R/ylrzuY3MtftIwAeY qX3Mos7b/IWcmKl6jobBVAf/6PMFIWrhYLGN8Qg7jgPsWpdEEz38uFWxzZveiS51Qvcb KA+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KZ7jlQC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id y18-20020a63b512000000b0058511efe7d7si8204506pge.97.2023.10.09.20.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 20:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KZ7jlQC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6D29F805DC6E; Mon, 9 Oct 2023 20:26:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441990AbjJJD0h (ORCPT + 99 others); Mon, 9 Oct 2023 23:26:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441902AbjJJD0f (ORCPT ); Mon, 9 Oct 2023 23:26:35 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FAA3A3 for ; Mon, 9 Oct 2023 20:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696908394; x=1728444394; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XgAxHxx0m+/LUb93YgECCjq29DfkSIaXjYuumR5Xu5o=; b=KZ7jlQC7crD2nFh6HdwhHAMVTKKtZInagrZ9S2Uof98fQHr7/Br0ma0R EPsCVM3M7Vw8vQ8fVK8gRyQ0rVR1Bg1Yg40tEJim1yLfMmGXVFRy1XqGY vSY1wy6Qk9vQa4S3Zftem7+9wGu3+qEjnyGuruJjeTh09r1dQnp7eVunt 8617UPHg8zUXBiPFl99IPgtSDpKy/sQSBHpAhbxxvVjbfb0bMiknObOZ6 qBe1MSXikFdQbgO1Xwm08l1bIibGbv2mLQ4ujWOZX7c+t/6nQuDwYxKAF MQLW5GHi5lmjlyANCOSF3ZrVdnAPRmXgqx29L44EItFB3poKtfKUsrLRa Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="5857304" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="5857304" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2023 20:26:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10858"; a="877060947" X-IronPort-AV: E=Sophos;i="6.03,211,1694761200"; d="scan'208";a="877060947" Received: from chenyu-dev.sh.intel.com ([10.239.62.164]) by orsmga004.jf.intel.com with ESMTP; 09 Oct 2023 20:26:30 -0700 From: Chen Yu To: Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot Cc: Phil Auld , Biju Das , Marek Szyprowski , linux-kernel@vger.kernel.org, Tim Chen , Chen Yu , Chen Yu Subject: [PATCH] sched/fair: Use printk_deferred instead of printk in pick_eevdf() Date: Tue, 10 Oct 2023 11:25:41 +0800 Message-Id: <20231010032541.339606-1-yu.c.chen@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 20:26:49 -0700 (PDT) X-Spam-Level: ** When no eligible entity is found in pick_eevdf(), it has to pick the entity with smallest vruntime. This indicates a potential issue and scheduler will print this error. However this printk could introduce possible circular locking issue because when the code path reaches here with the rq lock held, the printk could trigger further scheduling which loops back to the scheduler. Use printk_deferred() to defer the console write from current context to the irq work in the next tick. Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy") Suggested-by: Phil Auld Reported-by: Biju Das Reported-by: Marek Szyprowski Signed-off-by: Chen Yu --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 061a30a8925a..70f38e54b6ce 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -973,7 +973,7 @@ static struct sched_entity *pick_eevdf(struct cfs_rq *cfs_rq) if (!se) { struct sched_entity *left = __pick_first_entity(cfs_rq); if (left) { - pr_err("EEVDF scheduling fail, picking leftmost\n"); + printk_deferred(KERN_ERR "EEVDF scheduling fail, picking leftmost\n"); return left; } } -- 2.25.1