From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932209Ab1ACPGp (ORCPT ); Mon, 3 Jan 2011 10:06:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63947 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932110Ab1ACPGo (ORCPT ); Mon, 3 Jan 2011 10:06:44 -0500 Date: Mon, 3 Jan 2011 15:59:02 +0100 From: Oleg Nesterov To: Peter Zijlstra Cc: Yong Zhang , Chris Mason , Frank Rowand , Ingo Molnar , Thomas Gleixner , Mike Galbraith , Paul Turner , Jens Axboe , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 08/17] sched: Drop the rq argument to sched_class::select_task_rq() Message-ID: <20110103145902.GA7632@redhat.com> References: <20101224122338.172750730@chello.nl> <20101224123742.887559254@chello.nl> <20101229143136.GC2728@zhy> <1294053409.2016.59.camel@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1294053409.2016.59.camel@laptop> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03, Peter Zijlstra wrote: > > On Wed, 2010-12-29 at 22:31 +0800, Yong Zhang wrote: > > > - /* > > > - * select_task_rq() can race against ->cpus_allowed > > > - */ > > > - if (cpumask_test_cpu(dest_cpu, &p->cpus_allowed) && > > > - likely(cpu_active(dest_cpu)) && migrate_task(p, rq)) { > > > + if (likely(cpu_active(dest_cpu)) && need_migrate_task(p)) { > > > > If we drop rq_lock, need_migrate_task() maybe return true but > > p is already running on other cpu. Thus we do a wrong migration > > call. > > Yeah, too bad.. ;-) exec load balancing is more an optimistic thing > anyway, if it got rebalanced under out feet we don't care. I don't understand this need_migrate_task() at all (with or without the patch). This task is current/running, it should always return T. I guess, migrate_task() was needed before to initialize migration_req. Oleg.