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.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 16A70C5517A for ; Fri, 23 Oct 2020 14:14:32 +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 A56DB21527 for ; Fri, 23 Oct 2020 14:14:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A56DB21527 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz 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 266C96F88D; Fri, 23 Oct 2020 14:14:29 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 63D176F88B; Fri, 23 Oct 2020 14:14:27 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D31D2B2A6; Fri, 23 Oct 2020 14:14:25 +0000 (UTC) Subject: Re: [PATCH 04/65] mm: Extract might_alloc() debug check To: Daniel Vetter , DRI Development References: <20201021163242.1458885-1-daniel.vetter@ffwll.ch> <20201023122216.2373294-1-daniel.vetter@ffwll.ch> <20201023122216.2373294-4-daniel.vetter@ffwll.ch> From: Vlastimil Babka Message-ID: Date: Fri, 23 Oct 2020 16:14:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <20201023122216.2373294-4-daniel.vetter@ffwll.ch> Content-Language: en-US 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: Qian Cai , linux-xfs@vger.kernel.org, Thomas Gleixner , Andrew Morton , "Paul E . McKenney" , Peter Zijlstra , Intel Graphics Development , Randy Dunlap , Dave Chinner , Daniel Vetter , Ingo Molnar , Pekka Enberg , linux-mm@kvack.org, Mathieu Desnoyers , David Rientjes , linux-fsdevel@vger.kernel.org, Waiman Long , Joonsoo Kim , Michel Lespinasse , Christoph Lameter , Sebastian Andrzej Siewior Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 10/23/20 2:21 PM, Daniel Vetter wrote: > Extracted from slab.h, which seems to have the most complete version > including the correct might_sleep() check. Roll it out to slob.c. > > Motivated by a discussion with Paul about possibly changing call_rcu > behaviour to allocate memory, but only roughly every 500th call. > > There are a lot fewer places in the kernel that care about whether > allocating memory is allowed or not (due to deadlocks with reclaim > code) than places that care whether sleeping is allowed. But debugging > these also tends to be a lot harder, so nice descriptive checks could > come in handy. I might have some use eventually for annotations in > drivers/gpu. > > Note that unlike fs_reclaim_acquire/release gfpflags_allow_blocking > does not consult the PF_MEMALLOC flags. But there is no flag > equivalent for GFP_NOWAIT, hence this check can't go wrong due to > memalloc_no*_save/restore contexts. > > Cc: Paul E. McKenney > Cc: Christoph Lameter > Cc: Pekka Enberg > Cc: David Rientjes > Cc: Joonsoo Kim > Cc: Andrew Morton > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Vlastimil Babka > Cc: Mathieu Desnoyers > Cc: Sebastian Andrzej Siewior > Cc: Michel Lespinasse > Cc: Daniel Vetter > Cc: Waiman Long > Cc: Thomas Gleixner > Cc: Randy Dunlap > Cc: linux-mm@kvack.org > Cc: linux-fsdevel@vger.kernel.org > Cc: Dave Chinner > Cc: Qian Cai > Cc: linux-xfs@vger.kernel.org > Signed-off-by: Daniel Vetter Looks useful. Acked-by: Vlastimil Babka _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel