Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1398358pxv; Sat, 10 Jul 2021 03:09:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyRHzU4L6hxVJ0nQYbjt7JxjZz0TgenHq3TzuvxU9O5j34nNngEVap6lCeUi89orLNS9kq X-Received: by 2002:a17:906:544f:: with SMTP id d15mr5769492ejp.520.1625911775590; Sat, 10 Jul 2021 03:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625911775; cv=none; d=google.com; s=arc-20160816; b=UqpalglmbbWts72DbOMROvEDmTwzpcflJc1EWa1dW3jycjqacERGiv+PDnUxR6FHgK a4tN7XQtwTVTG+PHtjIUIQeHj+lCXeUA3WUJ80mleeKbFElolkhRXhKl8eU5d4bjItqv N3LCzdH2/HWBE9KF/4l7Qg2b9/WhQz2d6ZKczgair9EHMakT4rWTTNSnB7YTxQqByTI6 9eCTHzjxVU6P4I65fh24+g8Z/QEeU3PiZ6lEImmNOlXz5DWPqwlNO7IY+c+BbgOFXKZE 47/RRpZvgAAxfd1V5UydQbl9+Up0YVRTviwSsa2VCv7hpqae4hRAtn/OjgsJjzcreyK8 UwIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=RNNTUi2k5hKpYTfNePOQgK2g33vQoTbIIlGaOhs/3KE=; b=X+kjTl4aUu05f9mJkTpwRr9J6GJtj6g6FWXigWI8puK2Gc2vuIYEmd6gu5KuYJgD5v t/9XzmvhOCojjb/uca2/Z60aRbz/37D8dbh+w2NSkZoqCx0Fp8UDQlBq5KeeeA34rttw 6d+qDpTnQuy56xjHLufvmLkaVoZ/5VTVYt2JWlkNus/pjR2wXVUNVxXljp3WH01gkOrx 6ACO+Fg1eNhSs3SVnMaIQ5p96yz9zK8d/aq3WXQ4JwkUKkhDddrFLKjHIH5Hzg4gma7H obHS5Hsi+IfZptDq41/E2M7WWesy5SRiavsNwMTsgRBcoIicAkCBhI51JxmfApHNW8Mh hNSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hg2si4073037ejc.326.2021.07.10.03.09.12; Sat, 10 Jul 2021 03:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbhGJKGP (ORCPT + 99 others); Sat, 10 Jul 2021 06:06:15 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:11252 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbhGJKGH (ORCPT ); Sat, 10 Jul 2021 06:06:07 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4GMQSX59xtz1CGSP; Sat, 10 Jul 2021 17:57:48 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 10 Jul 2021 18:03:20 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , , Subject: [PATCH 4/5] mm/vmscan: add 'else' to remove check_pending label Date: Sat, 10 Jul 2021 18:03:28 +0800 Message-ID: <20210710100329.49174-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210710100329.49174-1-linmiaohe@huawei.com> References: <20210710100329.49174-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We could add 'else' to remove the somewhat odd check_pending label to make code core succinct. Signed-off-by: Miaohe Lin --- mm/vmscan.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index c580bef6b885..a74760c48bd8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3428,18 +3428,14 @@ static bool throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist, * blocked waiting on the same lock. Instead, throttle for up to a * second before continuing. */ - if (!(gfp_mask & __GFP_FS)) { + if (!(gfp_mask & __GFP_FS)) wait_event_interruptible_timeout(pgdat->pfmemalloc_wait, allow_direct_reclaim(pgdat), HZ); + else + /* Throttle until kswapd wakes the process */ + wait_event_killable(zone->zone_pgdat->pfmemalloc_wait, + allow_direct_reclaim(pgdat)); - goto check_pending; - } - - /* Throttle until kswapd wakes the process */ - wait_event_killable(zone->zone_pgdat->pfmemalloc_wait, - allow_direct_reclaim(pgdat)); - -check_pending: if (fatal_signal_pending(current)) return true; -- 2.23.0