From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762313Ab3ECClm (ORCPT ); Thu, 2 May 2013 22:41:42 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]:57454 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757783Ab3ECClk (ORCPT ); Thu, 2 May 2013 22:41:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <1367458508-9133-1-git-send-email-ccross@android.com> <1367458508-9133-4-git-send-email-ccross@android.com> <20130502235505.GW19814@mtj.dyndns.org> <20130503000358.GX19814@mtj.dyndns.org> Date: Thu, 2 May 2013 19:41:39 -0700 X-Google-Sender-Auth: xqn6fjglqHP0iFWoSxVhsZ3X2Gk Message-ID: Subject: Re: [PATCH v2 03/10] freezer: add new freezable helpers using freezer_do_not_count() From: Colin Cross To: Tejun Heo Cc: Linux PM list , lkml , "Rafael J. Wysocki" , =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= , Oleg Nesterov , Len Brown , Pavel Machek , Jeff Layton , Mandeep Baines Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 2, 2013 at 7:16 PM, Colin Cross wrote: > This sounds the same as what ended up getting reverted in > https://lkml.org/lkml/2013/3/4/221 > I can add the WARN_ON_ONCE to all my new calls, and leave them out of > existing calls, but that seems a little odd, and will be redundant if > the lockdep call in try_to_freeze goes back in in 3.11. Do you still > want it in the new apis? > > On Thu, May 2, 2013 at 5:03 PM, Tejun Heo wrote: >> On Thu, May 02, 2013 at 04:55:05PM -0700, Tejun Heo wrote: >>> So, the freezable interface can't be something that people can use >>> casually. It is something which should be carefully and strategically >>> deployed where we *know* that lock dependency risks don't exist or at >>> least are acceptable. I'm a bit weary that this patch is expanding >>> the interface a lot that they now look like the equivalents of normal >>> schedule calls. Not exactly sure what to do here but can we please at >>> least have RED BOLD BLINKING comments which scream to people not to >>> use these unless they know what they're doing? >> >> Maybe we should trigger WARN_ON_ONCE() if lockdep_depth() > 0 by >> default and have ugly variants which can be used if the caller is sure >> that it's okay possibly with list of locks which are held? >> >> -- >> tejun (sorry for the top post) I could also put the lockdep check that was reveted back into try_to_freeze(), and add a freezable_schedule_unsafe() that skips it for use in the known-unsafe users in nfs, with a big comment not to add new users of it.