Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758935Ab3FMTWC (ORCPT ); Thu, 13 Jun 2013 15:22:02 -0400 Received: from mail-qc0-f171.google.com ([209.85.216.171]:56798 "EHLO mail-qc0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756856Ab3FMTWA (ORCPT ); Thu, 13 Jun 2013 15:22:00 -0400 Date: Thu, 13 Jun 2013 12:21:52 -0700 From: Tejun Heo To: Andrew Morton Cc: Kent Overstreet , linux-kernel@vger.kernel.org, Oleg Nesterov , Christoph Lameter , Ingo Molnar , Andi Kleen , Jens Axboe , "Nicholas A. Bellinger" Subject: Re: [PATCH] Percpu tag allocator Message-ID: <20130613192152.GC13970@mtj.dyndns.org> References: <1371009804-11596-1-git-send-email-koverstreet@google.com> <20130612163854.91da28042ab7a943b69a5970@linux-foundation.org> <20130613190610.GA13970@mtj.dyndns.org> <20130613121324.2cab80256217df97254af16c@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130613121324.2cab80256217df97254af16c@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1333 Lines: 30 Hello, On Thu, Jun 13, 2013 at 12:13:24PM -0700, Andrew Morton wrote: > As I understand it, if a task is stuck in this loop at freeze time, the > whole freeze attempt will fail. But it's been a long time since I > thought about or worked on this stuff. It depends on who's calling the allocator but if the device driver or its midlayer is doing things properly, the ideal way would be the task being marked unfreezable (I think freezable kthreads harms more than help in general) and the driver suspend callback draining commands while not issuing new ones. What the tag allocator does doesn't really matter as all resources necessary for command execution should eventually be freed before entering suspend anyway. If that's not the case, the freezing should still be controlled by the caller and again the allocator should be able to return -EBUSY/INTR to indicate and then the caller, after releasing all other resources, shouldf to try_to_freeze(). There simply is no reliable way to tell from as deep as tag allocator whether it'd be safe to freeze or not. Thanks. -- tejun -- 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/