From patchwork Fri Feb 26 01:18:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12105447 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 7690DC433DB for ; Fri, 26 Feb 2021 01:18:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0D61864F03 for ; Fri, 26 Feb 2021 01:18:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D61864F03 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 930896B0095; Thu, 25 Feb 2021 20:18:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 906DE6B0096; Thu, 25 Feb 2021 20:18:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 844368D0001; Thu, 25 Feb 2021 20:18:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 727626B0095 for ; Thu, 25 Feb 2021 20:18:44 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 45B6F181AF5D3 for ; Fri, 26 Feb 2021 01:18:44 +0000 (UTC) X-FDA: 77858659368.14.8833AD0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id 4FDFE407F8F8 for ; Fri, 26 Feb 2021 01:18:38 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8303864F13; Fri, 26 Feb 2021 01:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614302322; bh=Wjzf7Wy1XNiCjLfKFdrmbrxjXNl//kp0itjsuMsup+U=; h=Date:From:To:Subject:In-Reply-To:From; b=MB8hCmsUMUvRh5OYbgxRlSueDoyRajrA+7OkrIyp4yZ/y0AoZZE+OwZj3jJA5IXmy dif3Va9XPDL8/vb77kq3aXiGTODu3o0LGVvJiPGaMeY903pPd+JmioKbbu0pecAHMf JPdkrwH8kx1C/qh61su8KIHo27BR932AYfbHFEoM= Date: Thu, 25 Feb 2021 17:18:41 -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 053/118] mm/dmapool: use might_alloc() Message-ID: <20210226011841.FKty5IXOj%akpm@linux-foundation.org> In-Reply-To: <20210225171452.713967e96554bb6a53e44a19@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4FDFE407F8F8 X-Stat-Signature: ok4qmbt9zi4yxs8yobe6j7taimb4u6kp Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf10; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614302318-870529 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/dmapool: 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. Link: https://lkml.kernel.org/r/20210113135009.3606813-1-daniel.vetter@ffwll.ch Signed-off-by: Daniel Vetter Signed-off-by: Andrew Morton --- mm/dmapool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/dmapool.c~mm-dmapool-use-might_alloc +++ a/mm/dmapool.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -319,7 +320,7 @@ void *dma_pool_alloc(struct dma_pool *po size_t offset; void *retval; - might_sleep_if(gfpflags_allow_blocking(mem_flags)); + might_alloc(mem_flags); spin_lock_irqsave(&pool->lock, flags); list_for_each_entry(page, &pool->page_list, page_list) {