From patchwork Mon Mar 18 15:23:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 15407 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 485E923E3E for ; Mon, 18 Mar 2013 15:25:10 +0000 (UTC) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by fiordland.canonical.com (Postfix) with ESMTP id 079C7A19711 for ; Mon, 18 Mar 2013 15:25:09 +0000 (UTC) Received: by mail-ve0-f175.google.com with SMTP id cy12so4419653veb.20 for ; Mon, 18 Mar 2013 08:25:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:x-gm-message-state; bh=jDlOWNRMD+x5Whfiswz6jDlv4OZDA7wkQCt01NdGMIw=; b=XVNdN0jdkSYPVDl7v6KkWXzuEdjmeyqFL5yGYuD0Wx2ZsvnMMZg9vzqk5ByQiAe2wF 5q2NJ+JU0242WMhUfgAzgNcI+v4k9bu1omgn3vN3SQg5YBywKAbS8CrXgxp1va8//h18 0uv0EEBMJbXUzXL+YZV+JNYdX8WJGxl5qq+sSkPk5oNPK4rEcZ/n2uiXYhExj7IRp1i8 NmmRnSF56BTFEYpvy5nzoSAISTGtREcDe9ft5vWbIz1Fc4eFPiVBfeEBV6sHbzKSpvy1 7VASBEGrdG46uKLxXKKbxO3SUKMnHtAKWinFY2p11yUJpyxbl43GzRFsgNO6ovi96pU0 uLBA== X-Received: by 10.220.242.73 with SMTP id lh9mr19659205vcb.49.1363620309566; Mon, 18 Mar 2013 08:25:09 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp29057veb; Mon, 18 Mar 2013 08:25:09 -0700 (PDT) X-Received: by 10.68.179.67 with SMTP id de3mr33854210pbc.130.1363620308630; Mon, 18 Mar 2013 08:25:08 -0700 (PDT) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id vr5si7060166pab.5.2013.03.18.08.25.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:25:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) smtp.mail=viresh.kumar@linaro.org Received: by mail-pb0-f54.google.com with SMTP id rr4so6493989pbb.13 for ; Mon, 18 Mar 2013 08:25:08 -0700 (PDT) X-Received: by 10.68.225.138 with SMTP id rk10mr33306034pbc.146.1363620308078; Mon, 18 Mar 2013 08:25:08 -0700 (PDT) Received: from localhost ([122.167.69.232]) by mx.google.com with ESMTPS id na4sm20539900pbc.8.2013.03.18.08.25.01 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:25:07 -0700 (PDT) From: Viresh Kumar To: pjt@google.com, paul.mckenney@linaro.org, tglx@linutronix.de, tj@kernel.org, suresh.b.siddha@intel.com, venki@google.com, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org Cc: linaro-kernel@lists.linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, Arvind.Chauhan@arm.com, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , Dave Airlie , linux-fbdev@vger.kernel.org Subject: [PATCH V3 7/7] fbcon: queue work on any cpu Date: Mon, 18 Mar 2013 20:53:29 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmFUkuK1/B2k38eNZJisYHZiIy0S0ZT/5lTJnxGiAuIQ2W1jTGbpnvoI+l3Ci1Fans3y+77 fbcon uses workqueues and it has no real dependency of scheduling these on the cpu which scheduled them. On a idle system, it is observed that and idle cpu wakes up few times just to service this work. It would be better if we can schedule it on a cpu which isn't idle to save on power. By idle cpu (from scheduler's perspective) we mean: - Current task is idle task - nr_running == 0 - wake_list is empty This patch replaces schedule_work() routine with queue_work_on_any_cpu() sibling with system_wq as workqueue. This routine would look for the closest (via scheduling domains) non-idle cpu (non-idle from schedulers perspective). If the current cpu is not idle or all cpus are idle, work will be scheduled on local cpu. Cc: Dave Airlie Cc: linux-fbdev@vger.kernel.org Signed-off-by: Viresh Kumar --- drivers/video/console/fbcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 3cd6759..a900997 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -404,7 +404,7 @@ static void cursor_timer_handler(unsigned long dev_addr) struct fb_info *info = (struct fb_info *) dev_addr; struct fbcon_ops *ops = info->fbcon_par; - schedule_work(&info->queue); + queue_work_on_any_cpu(system_wq, &info->queue); mod_timer(&ops->cursor_timer, jiffies + HZ/5); }