From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934758AbZJJCli (ORCPT ); Fri, 9 Oct 2009 22:41:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934749AbZJJCli (ORCPT ); Fri, 9 Oct 2009 22:41:38 -0400 Received: from smtp-out.google.com ([216.239.45.13]:20148 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754144AbZJJClh (ORCPT ); Fri, 9 Oct 2009 22:41:37 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:to:subject:message-id:user-agent:mime-version:content-type; b=JWZy3obNIWxwx/QhiJjyCIm1amyBKirRvdUHbIyj+JdqeJMlCyAEVCiCMjcqtkx8r 5t4K9SoLQtX3yVu+UZWHw== Date: Fri, 9 Oct 2009 19:40:06 -0700 (PDT) From: Paul Turner To: mingo@elte.hu, peterz@infradead.org, linux-kernel@vger.kernel.org Subject: sched: race between deactivate and switch sched_info accounting? Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, While chasing down some performance we found inconsistenies in the accounting of run-delay. Tracking this down I think there exists a race condition in which a task can 're-arrive' without updating its queuing accounting. This can lead to incorrect run_delay and rq_cpu_time accounting. Consider a flow such as: 1. task p blocks, enters schedule() 2. we deactivate p 3. there's nothing else so we load balance 4. during load balance we lock balance and a remote cpu succeeds in re-activating p 5. we then re-pick next==p 6. we skip the accounting update since prev==next, start running p again (last_arrival is left polluted with our prior arrival)