Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3633060ybl; Mon, 19 Aug 2019 23:16:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqysR+6iU7UiIDt3La2wYMmngFkyNnGK83KiciiDof9OnRxvTiUw9CjhIFw6Bk05PtC+ZhD2 X-Received: by 2002:aa7:934f:: with SMTP id 15mr27896733pfn.22.1566281763198; Mon, 19 Aug 2019 23:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566281763; cv=none; d=google.com; s=arc-20160816; b=0xT6/eDmqSevWDtOekS+u/MpewFqQeZvlRy4r+BS9xEs9OuM+Zh/zAN5FeS5Od0JHG bK7LIEafy0ENRTqhak20veFQwn2OsmWKRQJZvQnkZSgnegpzs58J4mcsQU+4HqxOH+xZ ULCeI4kvt4jbPZY4pZEQCpQ8WxcV7gx7NCz6eIiwQ9g36sCTVAKZdSIhotDk2V6sVJtA m3zJvsIwZV9TImwgYz0GD5xZDRsCEoYBe7u5mgcJDDCuvaNWRRfLWzuv31iXn/yoIsdk uXZrctAGZUGlyG+LU9JX/ioq6e/MTf2yWUv3qgNv6+z25I+E2ZJAIMcwyiSI/5cl118Z 5nvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=2Rkx1o6sWSNY21Q3MnNz1y4rcc7n1BW0NJRzScVJzSE=; b=EcAhRSThP5BUE76E2aOU6enXDT5yyat+PRGupu3mPmQMl8qXrelPukuvkPr15OKmTb bXsL2uN0RWqnxUIKZ+jDYEVIDcrcGJ6kfdeI03Eny3QanvZNueHMYp89UO66KzeFkaXF HN56A2auMcTfTyTK6Lz3mb4FvnEBpOwDWuQGQqNHzsTyzuvQJYV6iOaybZf29AfeGaxj dO7UhI0++kZ4i4g9pRvHp0IM3DPRUfMIYPTTVNj1SA88NHzTp5XaNr1fxin6PYCTVZ7J P2WIO33bRqRe5IJeyB+DJkfGK9NiMDem4gotGBg6E7qbO4TKPwr5MVLADCKJFki01clk 7Vfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=eNXF2VaE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si11382272pls.185.2019.08.19.23.15.48; Mon, 19 Aug 2019 23:16:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=eNXF2VaE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729284AbfHTGOu (ORCPT + 99 others); Tue, 20 Aug 2019 02:14:50 -0400 Received: from linux.microsoft.com ([13.77.154.182]:37832 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728878AbfHTGOu (ORCPT ); Tue, 20 Aug 2019 02:14:50 -0400 Received: by linux.microsoft.com (Postfix, from userid 1004) id 663C820B7195; Mon, 19 Aug 2019 23:14:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 663C820B7195 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1566281689; bh=2Rkx1o6sWSNY21Q3MnNz1y4rcc7n1BW0NJRzScVJzSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eNXF2VaEip8OvlyZdhnOxMPgL2MMdaGBG5sf8QGulyP7h4zd0gqGfoja+4kQ7Zm92 Tlby/vtpIdQvo8AU0hccvMtO4XTEhpQ7tb+2Cw0Dkkog8OWU9kqiAegnC07oV75kzp UtAHGYhmAqIx7Lc4ctLsrXkZ9HCWQYx2ruNVqRpQ= From: longli@linuxonhyperv.com To: Ingo Molnar , Peter Zijlstra , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [PATCH 2/3] sched: export idle_cpu() Date: Mon, 19 Aug 2019 23:14:28 -0700 Message-Id: <1566281669-48212-3-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1566281669-48212-1-git-send-email-longli@linuxonhyperv.com> References: <1566281669-48212-1-git-send-email-longli@linuxonhyperv.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li This function is useful for device drivers to check if this CPU has work to do in process context. Signed-off-by: Long Li --- include/linux/sched.h | 1 + kernel/sched/core.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/linux/sched.h b/include/linux/sched.h index 575f1ef7b159..a209941c1770 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1501,6 +1501,7 @@ current_restore_flags(unsigned long orig_flags, unsigned long flags) extern int cpuset_cpumask_can_shrink(const struct cpumask *cur, const struct cpumask *trial); extern int task_can_attach(struct task_struct *p, const struct cpumask *cs_cpus_allowed); extern u64 get_cpu_rq_switches(int cpu); +extern int idle_cpu(int cpu); #ifdef CONFIG_SMP extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask); extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 1a76f0e97c2d..d1cedfb38174 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4023,6 +4023,7 @@ int idle_cpu(int cpu) return 1; } +EXPORT_SYMBOL_GPL(idle_cpu); /** * available_idle_cpu - is a given CPU idle for enqueuing work. -- 2.17.1