From patchwork Fri Feb 26 01:18:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12105449 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 CAB2BC43331 for ; Fri, 26 Feb 2021 01:18:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 656BE64EE2 for ; Fri, 26 Feb 2021 01:18:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 656BE64EE2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EADA16B006E; Thu, 25 Feb 2021 20:18:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E0FB86B0098; Thu, 25 Feb 2021 20:18:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D253F6B0099; Thu, 25 Feb 2021 20:18:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id B81006B006E for ; Thu, 25 Feb 2021 20:18:47 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8B0C6180ACEE4 for ; Fri, 26 Feb 2021 01:18:47 +0000 (UTC) X-FDA: 77858659494.25.8AB1C8F Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf13.hostedemail.com (Postfix) with ESMTP id 98F2FE0011D2 for ; Fri, 26 Feb 2021 01:18:44 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E3A4E64F2C; Fri, 26 Feb 2021 01:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614302326; bh=0Ag/HJ1j9d8tj7P8IcswBjUmM1000KSxYpTWpTiEZq8=; h=Date:From:To:Subject:In-Reply-To:From; b=br09TGjpoZfl0jmvcfjGXKM/5BLzbA0/nPyU9Ag7QKbs1i/ho5uafdVhTgHXCPblJ f5WGzLhXrkjxBhQIXrRo8KdkC4dNeoaMkgnsdpBttct8TJeYj7Ou/NfFlKxRgZJJdG L60YtuB9/FAFdo9UlEKHDlml3JqjKyAkRGcMqfsg= Date: Thu, 25 Feb 2021 17:18:45 -0800 From: Andrew Morton To: akpm@linux-foundation.org, daniel.vetter@ffwll.ch, daniel.vetter@intel.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 054/118] mm/backing-dev.c: use might_alloc() Message-ID: <20210226011845.1L0FuhJb6%akpm@linux-foundation.org> In-Reply-To: <20210225171452.713967e96554bb6a53e44a19@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 98F2FE0011D2 X-Stat-Signature: omcm45eqqfykadf44s8sw7kgm6b164gr Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614302324-933779 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: From: Daniel Vetter Subject: mm/backing-dev.c: use might_alloc() Now that my little helper has landed, use it more. On top of the existing check this also uses lockdep through the fs_reclaim annotations. [akpm@linux-foundation.org: include linux/sched/mm.h] Link: https://lkml.kernel.org/r/20210113135009.3606813-2-daniel.vetter@ffwll.ch Signed-off-by: Daniel Vetter Signed-off-by: Andrew Morton --- mm/backing-dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/backing-dev.c~bdi-use-might_alloc +++ a/mm/backing-dev.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -578,7 +579,7 @@ struct bdi_writeback *wb_get_create(stru { struct bdi_writeback *wb; - might_sleep_if(gfpflags_allow_blocking(gfp)); + might_alloc(gfp); if (!memcg_css->parent) return &bdi->wb;