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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 DC840C56201 for ; Fri, 20 Nov 2020 17:31:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 445932245A for ; Fri, 20 Nov 2020 17:31:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (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 445932245A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FA806E8D8; Fri, 20 Nov 2020 17:31:53 +0000 (UTC) Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 453516E8D8 for ; Fri, 20 Nov 2020 17:31:53 +0000 (UTC) Received: by mail-oi1-x242.google.com with SMTP id f11so11284616oij.6 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=XToQTe7DiaqgwH2175b0hTvU9IT8MELjMOqycN24s1E/CKyY2cFdCxTQzNS8k7Fbpp M3ZJb1t2PD+gblsaGh40G7WYLEd2xb+Zq2zQjMWw6Lmig2sVONzk5gwFZHxijeY6axP8 eBOjFgyTHYXU4CETfenFsFhmoNetSlCScIX614bPIPT9PHl2KSSj3IQM1DJ2WpdKRVyV x3mZA9bsna6otlbN2mmLA9fRFMqq3uA2mSFfirRBkGKI399Ply0AjuQ5xrOJoozzn9jP 9aaxBh5kCFyELj9aF1UFUv0Ht1AS1ZNB3y+o/U67Ekz1tDSUgxoS2vDx1dqyeCc2PA69 1pag== X-Gm-Message-State: AOAM533UyueWkN6s0qEqbe4XKd/F0fcHbsyCqffJC2BEzh9X0xQNxjc3 KHeT9cd5m5QlKCSYaBj60pQcTFdS4BC3DVLPUz6IFg== 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Sebastian Andrzej Siewior , Dave Chinner , DRI Development , Linux MM , Daniel Vetter , Christoph Lameter , Michel Lespinasse , Ingo Molnar , linux-xfs@vger.kernel.org, "Matthew Wilcox \(Oracle\)" , David Rientjes , Waiman Long , "Paul E . McKenney" , Intel Graphics Development , Qian Cai , Thomas Gleixner , Joonsoo Kim , Vlastimil Babka , LKML , Pekka Enberg , linux-fsdevel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel