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: 2293681 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F28B0DF215 for ; Mon, 18 Mar 2013 15:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753605Ab3CRPac (ORCPT ); Mon, 18 Mar 2013 11:30:32 -0400 Received: from mail-da0-f45.google.com ([209.85.210.45]:58659 "EHLO mail-da0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586Ab3CRPab (ORCPT ); Mon, 18 Mar 2013 11:30:31 -0400 Received: by mail-da0-f45.google.com with SMTP id v40so1413261dad.4 for ; Mon, 18 Mar 2013 08:30:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=Xbg7mVhm0istdMnCv7MpqnLgVWYQz/VUEBCfeB0EvPVRlRbZPfVCfkPPc3Xb6pg3g+ J+sNZDGgtmVbwBEnX5CMdh+z6+FMJpvLdZcXyDd3tO9VCq0rHiur0/oaaqVJxShLU+I1 GPOx6V+eOiU7V+yGFwfxzkl4dKtlTFmwKM4BS70VG8D9HA8T/M9/CRWm0SoLMv24+o3P 4qXHzBxLmym2UxYUlqLiw1G8GsTYP8ymqcHZ69GTyi+16D+YRuW8R7TXCggAjvLPApAY 4nwOwvBsGb3dwOvdVK+h4uj+XxZVVZj4KBHJ5my/ExVCSmtBxZhTX+5sPCRNM2ZCYiDV gMdA== 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: ALoCoQnbaF7CSUts71D6MiFfvWf+shM0bo+gfyOqp3Lj5uqgrWAsnk7a1VRjjypX7KNQFcg9ekrw Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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); }