From patchwork Sun Jun 5 15:25:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12869777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCDBECCA47B for ; Sun, 5 Jun 2022 15:25:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD19C8D0002; Sun, 5 Jun 2022 11:25:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D56808D0001; Sun, 5 Jun 2022 11:25:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD04C8D0002; Sun, 5 Jun 2022 11:25:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AD8518D0001 for ; Sun, 5 Jun 2022 11:25:47 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 82216803A2 for ; Sun, 5 Jun 2022 15:25:47 +0000 (UTC) X-FDA: 79544557134.14.F9ECC77 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf04.hostedemail.com (Postfix) with ESMTP id 073214000B for ; Sun, 5 Jun 2022 15:25:25 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id z7so15763732edm.13 for ; Sun, 05 Jun 2022 08:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oBSo6LhPKNDFYlpKsrymkakMP0nVeotmS2LDUe++2Ag=; b=MI2W98/bl4fvsuc7EA8n3jW7RtyXsolzKl8iYKGjUKHxpV+xI4yWBh9si/SfGcnemX Wp8Z6Ka4sKIw3ARIJrGTE81BjutbjE8F98r+5LHsywIlLVbH8ZT9BpS2oa3MAZ3Rs2gu AdGWx4erG8ZpDjcF3eYxvJR82Nlg41YU9S044= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oBSo6LhPKNDFYlpKsrymkakMP0nVeotmS2LDUe++2Ag=; b=gAfmij0exC/RETuHFKfHZAGQFfzjMvlowCAfjnjCjykTu5NT97etn7osIka44cxyQb DPcUef61ipz72xRHMOTrVKWA89LgaOmlBtrNvscRbe2cePqrK6m0PAp54xFjGKMWp7XT Rq6kiiGpRnaZv1VkOxkpiqSaVLSF8I07NSsoyoWi/QFp51ONTPZkAQvToXGzd8rwnNSj SUbv+m7kbbiXqOkGlaPXFbYv8QKTVzv29qmiPyeUcV1O5VyldNvYF9FBQQqqQ/NS2cie iAG6cDCGOSEIJsf7gvDPLWeEY/GUpxcoC467ItpAwzAPQScYV7O1XU2Wh3Knz9bNrujR lERA== X-Gm-Message-State: AOAM533v6hcCAtIOSeBzUGIgwJmaoxhCoZEeeS218O/GxHfQp8SaSayD b9LZZzPI5Cuh4JPzWyDjfraQxg== X-Google-Smtp-Source: ABdhPJyz+DCsoFSlGZIktlTYtkVTK8pml1UNEzc+5GGMb5RBEfVAt3+lSGDPBsrviNR+kw3jH8t97w== X-Received: by 2002:a05:6402:42d4:b0:412:c26b:789 with SMTP id i20-20020a05640242d400b00412c26b0789mr21414271edc.232.1654442745494; Sun, 05 Jun 2022 08:25:45 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l21-20020a056402125500b0042dddaa8af3sm7051499edw.37.2022.06.05.08.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 08:25:44 -0700 (PDT) From: Daniel Vetter To: LKML Cc: DRI Development , Daniel Vetter , Daniel Vetter , Andrew Morton , linux-mm@kvack.org Subject: [PATCH 1/3] mm/page_alloc: use might_alloc() Date: Sun, 5 Jun 2022 17:25:37 +0200 Message-Id: <20220605152539.3196045-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-Stat-Signature: hnxhgzyc448ku6en8ksku3mgjgzq4iru Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=ffwll.ch header.s=google header.b="MI2W98/b"; dmarc=none; spf=none (imf04.hostedemail.com: domain of daniel.vetter@ffwll.ch has no SPF policy when checking 209.85.208.51) smtp.mailfrom=daniel.vetter@ffwll.ch X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 073214000B X-HE-Tag: 1654442725-953274 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: ... instead of open codding it. Completely equivalent code, just a notch more meaningful when reading. Signed-off-by: Daniel Vetter Cc: Andrew Morton Cc: linux-mm@kvack.org Reviewed-by: David Hildenbrand Reviewed-by: Vlastimil Babka --- mm/page_alloc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2db95780e003..277774d170cb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5177,10 +5177,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, *alloc_flags |= ALLOC_CPUSET; } - fs_reclaim_acquire(gfp_mask); - fs_reclaim_release(gfp_mask); - - might_sleep_if(gfp_mask & __GFP_DIRECT_RECLAIM); + might_alloc(gfp_mask); if (should_fail_alloc_page(gfp_mask, order)) return false;