From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60A04C63777 for ; Fri, 20 Nov 2020 17:31:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E9132225B for ; Fri, 20 Nov 2020 17:31:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="HccBEp+o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E9132225B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 263E26B005D; Fri, 20 Nov 2020 12:31:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 210F66B006C; Fri, 20 Nov 2020 12:31:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08B936B006E; Fri, 20 Nov 2020 12:31:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id CB9426B005D for ; Fri, 20 Nov 2020 12:31:54 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6B205180AD811 for ; Fri, 20 Nov 2020 17:31:54 +0000 (UTC) X-FDA: 77505489348.06.milk63_0f03fdd2734d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 40EAF1004C9D0 for ; Fri, 20 Nov 2020 17:31:54 +0000 (UTC) X-HE-Tag: milk63_0f03fdd2734d X-Filterd-Recvd-Size: 4965 Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 17:31:53 +0000 (UTC) Received: by mail-oi1-f194.google.com with SMTP id o25so11285836oie.5 for ; Fri, 20 Nov 2020 09:31:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8e4wI0bZkx7vL4ZNjNtbjWVMpWuuSKoV5XC8ZjlhW7s=; b=HccBEp+o8ETH4Up44ZRai+3YCDp9ZccG/73PRJf6l8P+2CSniNIKgzDRc27ybuIOvR IIsOfywoVBFSGx1Qv7sDxfm4sSmrQlSiigm0wYSweoIK2JSHh+CJnJrDkOciZn38yhj0 aSga/Z7C/8a9/MwtRVQ0bNGZZBwYGOLWIM6AA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8e4wI0bZkx7vL4ZNjNtbjWVMpWuuSKoV5XC8ZjlhW7s=; b=cbzz/0MxdtZMzNW+7MfSVoQ5QtyIurFUdLOhjXJ43AaY138fczSwysd8JZa8KymVkV D37kB/XD5o/XVmV1yVYcr3iGnJ00o2LSvHZ6on1/drvJ4FoB6oM9KUc3lGp6gaKNTMAl gu0NR1w8CzBPVqcmj0nNVcRsaBCOlP+0WwY9bJ1P6X3b8frJfFm7byFWSg5B0eyHcXL3 ydTgGOB8OiPabHAl79Gu397SBKF0UCYMyrPAmP+4/SIbdFrA9mdKBDda3c1F9NchjoAV Zo1TcrXraDmTzdRit+I+y2LTBQ6utt8VEqVOb1DXza71YBGLEHu++am6HzCzfsF35/5k MRUA== X-Gm-Message-State: AOAM530cAtHDvKonsMT3wZzZX3Zm/7/pLIc7h6NQvT/9DoAJ3J53GKoZ cAHjZVAta+P67sULSJ08nauBzDyh0Vwa+ivovIa95Q== X-Google-Smtp-Source: ABdhPJx/L8V6caZCi2etf09pugpqxuriDzOj95Aq3JU3B7KOKGDyXyFPWC3ezSK49DgmKXY+U4gQxivRIffbahFPXew= X-Received: by 2002:aca:1713:: with SMTP id j19mr6618133oii.101.1605893512499; Fri, 20 Nov 2020 09:31:52 -0800 (PST) MIME-Version: 1.0 References: <20201120095445.1195585-1-daniel.vetter@ffwll.ch> <20201120095445.1195585-3-daniel.vetter@ffwll.ch> In-Reply-To: From: Daniel Vetter Date: Fri, 20 Nov 2020 18:31:41 +0100 Message-ID: Subject: Re: [PATCH 2/3] mm: Extract might_alloc() debug check To: Randy Dunlap Cc: DRI Development , Intel Graphics Development , Linux MM , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, LKML , Vlastimil Babka , "Paul E . McKenney" , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Peter Zijlstra , Ingo Molnar , Mathieu Desnoyers , Sebastian Andrzej Siewior , Michel Lespinasse , Waiman Long , Thomas Gleixner , Dave Chinner , Qian Cai , "Matthew Wilcox (Oracle)" , Daniel Vetter Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 20, 2020 at 6:20 PM Randy Dunlap wrote: > > Hi, > > On 11/20/20 1:54 AM, Daniel Vetter wrote: > > diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h > > index d5ece7a9a403..f94405d43fd1 100644 > > --- a/include/linux/sched/mm.h > > +++ b/include/linux/sched/mm.h > > @@ -180,6 +180,22 @@ static inline void fs_reclaim_acquire(gfp_t gfp_mask) { } > > static inline void fs_reclaim_release(gfp_t gfp_mask) { } > > #endif > > > > +/** > > + * might_alloc - Marks possible allocation sites > > Mark > > > + * @gfp_mask: gfp_t flags that would be use to allocate > > used > > > + * > > + * Similar to might_sleep() and other annotations this can be used in functions > > annotations, > > > + * that might allocate, but often dont. Compiles to nothing without > > don't. > > > + * CONFIG_LOCKDEP. Includes a conditional might_sleep() if @gfp allows blocking. > > ? might_sleep_if() if That's one if too many, I'll do the others for next round. Thanks for taking a look. -Daniel > > > + */ > > +static inline void might_alloc(gfp_t gfp_mask) > > +{ > > + fs_reclaim_acquire(gfp_mask); > > + fs_reclaim_release(gfp_mask); > > + > > + might_sleep_if(gfpflags_allow_blocking(gfp_mask)); > > +} > > > -- > ~Randy > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch