From patchwork Sun Mar 8 13:32:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 11425629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D42792A for ; Sun, 8 Mar 2020 13:32:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A52320866 for ; Sun, 8 Mar 2020 13:32:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JHkgko6h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A52320866 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 559666B0005; Sun, 8 Mar 2020 09:32:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4E3416B0006; Sun, 8 Mar 2020 09:32:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AA526B0007; Sun, 8 Mar 2020 09:32:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 1FC106B0005 for ; Sun, 8 Mar 2020 09:32:40 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DB2B18248047 for ; Sun, 8 Mar 2020 13:32:39 +0000 (UTC) X-FDA: 76572284838.02.cloud47_3451829a58136 X-Spam-Summary: 2,0,0,1b4f71d00dcb29c2,d41d8cd98f00b204,qiwuchen55@gmail.com,,RULES_HIT:41:355:379:541:800:960:965:966:973:988:989:1260:1345:1534:1539:1568:1711:1714:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2731:3138:3139:3140:3141:3142:3867:4321:4385:4390:4395:5007:6261:6642:6653:7576:9413:10004:11026:11658:11914:12043:12297:12517:12519:12555:12679:12895:12986:13069:13311:13357:14181:14384:14394:14721:21080:21444:21451:21627:21666:21990:30012:30054,0,RBL:209.85.210.194:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: cloud47_3451829a58136 X-Filterd-Recvd-Size: 3260 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Sun, 8 Mar 2020 13:32:39 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id z65so3580351pfz.8 for ; Sun, 08 Mar 2020 06:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=TbHLckbqV+AQRMgQaceXDkt+K9hzxrxRGNhxhD9qrRg=; b=JHkgko6h6rA+EAR3x2Gyp3tWAqWN2iFqVaxVemNePuMlmk2tzsOrUPcAENrqWWKAc9 RO6nfiZ7sIaUGJh4fEyx5h4Q3azfUBwM3DuwZ8S0yymhaBBZQqHyYRuM7lRkT0wNkIlc /kQx0GmamkyOM5vfyRgoVPsJAfNWoHtXL2rtiprrwTCTGE66R1d3Fj4rhr7dayCt0FVA r8/HKP7k7MVRaMWBtmEgbFEqroiBP8BJbKveMuWjffzhoQPhE9JbQM5g3zoFWMYruSFt g2cv5EQSrLVL2KQFOZd92+M568aqSLYsR7wCWRWdus0p4FLSa5CwKdbGpo+QtPlPde4u 7wKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TbHLckbqV+AQRMgQaceXDkt+K9hzxrxRGNhxhD9qrRg=; b=nKRUCkrZlau5bo0ddWtKyP5BlrRzpdkGoTcDe3OScy1WUD4tsrilIcLAJ5281pdbdv 3krsMNAHOzPCsAhF2LNY8sq+MWt2RYjJADroMSpox+2i5uUFD1H+PwrXek8168qTQMuk xrJNzbOhVoepHGDd4wQhkEaP6CnFyGIns9teYwYs+N9OSkd14UzMzdyH1vh139Jhn+oc gb3jX/88wtrdcduixSxXnoRwOhSuKeZY1ZOYifo72K1uCc1Lg3+hz2hU547EmtgNG6VK lb0zWMWduyBe4hw3gRhXQ2C60NB4pQeI4LLzMl53g/L36Paw851WvfCpMkn108e4G6OH hkYw== X-Gm-Message-State: ANhLgQ2wOjdFCozJhS0qy1QAKoAW0An5ZyFR6t/A5qN3v7htwO4Jc5go 2SP1ZwjEfIEwi8OJKHz+FaA= X-Google-Smtp-Source: ADFU+vsOXFrUrb0MSTZ+IliiUqDxwVoPdmR2rx5mLJAWsFKq4S7ZLvaobQP2zMtgSAGVkp+mXkk32g== X-Received: by 2002:a63:2:: with SMTP id 2mr11663689pga.102.1583674358512; Sun, 08 Mar 2020 06:32:38 -0700 (PDT) Received: from localhost ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id b4sm43372113pfd.18.2020.03.08.06.32.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 08 Mar 2020 06:32:38 -0700 (PDT) From: qiwuchen55@gmail.com To: akpm@linux-foundation.org, willy@infradead.org Cc: linux-mm@kvack.org, chenqiwu Subject: [PATCH v2] mm/page_alloc: use free_area_empty() instead of open-coding Date: Sun, 8 Mar 2020 21:32:34 +0800 Message-Id: <1583674354-7713-1-git-send-email-qiwuchen55@gmail.com> X-Mailer: git-send-email 1.9.1 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: chenqiwu Use free_area_empty() API to replace list_empty() for better code readability. Signed-off-by: chenqiwu Reviewed-by: Matthew Wilcox (Oracle) --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 79e950d..e78b780 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3533,8 +3533,7 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, return true; } #endif - if (alloc_harder && - !list_empty(&area->free_list[MIGRATE_HIGHATOMIC])) + if (alloc_harder && !free_area_empty(area, MIGRATE_HIGHATOMIC)) return true; } return false;