Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933527Ab3D3RO2 (ORCPT ); Tue, 30 Apr 2013 13:14:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28494 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933340Ab3D3ROZ (ORCPT ); Tue, 30 Apr 2013 13:14:25 -0400 Date: Tue, 30 Apr 2013 19:10:59 +0200 From: Oleg Nesterov To: Colin Cross Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , arve@android.com, Tejun Heo , Li Zefan , Len Brown , Pavel Machek , containers@redhat.com Subject: Re: [PATCH 02/10] freezer: skip waking up tasks with PF_FREEZER_SKIP set Message-ID: <20130430171059.GA28944@redhat.com> References: <1367271946-7239-1-git-send-email-ccross@android.com> <1367271946-7239-3-git-send-email-ccross@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1367271946-7239-3-git-send-email-ccross@android.com> 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 Content-Length: 738 Lines: 26 On 04/29, Colin Cross wrote: > > @@ -46,10 +46,10 @@ static int try_to_freeze_tasks(bool user_only) > todo = 0; > read_lock(&tasklist_lock); > do_each_thread(g, p) { > - if (p == current || !freeze_task(p)) > + if (p == current || freezer_should_skip(p)) > continue; > > - if (!freezer_should_skip(p)) > + if (freeze_task(p)) > todo++; What if we race with freezer_count() ? try_to_freeze_tasks() can wrongly succeed leaving the running task unfrozen, no? Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/