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 56EECC55179 for ; Fri, 23 Oct 2020 14:14:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BAD4B21D47 for ; Fri, 23 Oct 2020 14:14:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAD4B21D47 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A01926B006E; Fri, 23 Oct 2020 10:14:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B1C06B0070; Fri, 23 Oct 2020 10:14:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A03F6B0071; Fri, 23 Oct 2020 10:14:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 59B5D6B006E for ; Fri, 23 Oct 2020 10:14:28 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E51E48BB8637 for ; Fri, 23 Oct 2020 14:14:27 +0000 (UTC) X-FDA: 77403385374.03.nose51_240a79d2725a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id C461528A4E8 for ; Fri, 23 Oct 2020 14:14:27 +0000 (UTC) X-HE-Tag: nose51_240a79d2725a X-Filterd-Recvd-Size: 3916 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf27.hostedemail.com (Postfix) with ESMTP for ; 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 Cc: Intel Graphics Development , "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 , Randy Dunlap , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Dave Chinner , Qian Cai , linux-xfs@vger.kernel.org, Daniel Vetter 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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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