From patchwork Tue Apr 21 21:38:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11502239 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 EA75281 for ; Tue, 21 Apr 2020 21:38:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B803A206D5 for ; Tue, 21 Apr 2020 21:38:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="giZgIw5h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B803A206D5 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 7AF498E0006; Tue, 21 Apr 2020 17:38:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7874F8E0003; Tue, 21 Apr 2020 17:38:51 -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 5B1A18E0006; Tue, 21 Apr 2020 17:38:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 406F78E0003 for ; Tue, 21 Apr 2020 17:38:51 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 001F51269 for ; Tue, 21 Apr 2020 21:38:50 +0000 (UTC) X-FDA: 76733177220.20.class45_130519815ca4b X-Spam-Summary: 2,0,0,6010a4e8628c9872,d41d8cd98f00b204,richard.weiyang@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1359:1437:1534:1539:1568:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3867:3871:4321:5007:6119:6120:6261:6653:7514:7901:7903:9413:10004:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:12986:13069:13311:13357:14181:14384:14687:14721:21080:21444:21627:21666:21990:30054,0,RBL:209.85.221.68:@gmail.com:.lbl8.mailshell.net-62.18.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:24,LUA_SUMMARY:none X-HE-Tag: class45_130519815ca4b X-Filterd-Recvd-Size: 3459 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Apr 2020 21:38:50 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id d17so18244436wrg.11 for ; Tue, 21 Apr 2020 14:38:50 -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:in-reply-to:references; bh=WRpu/B/BcLywABR29mrWPu2uoAJ9/VJSM0fTjNe1z1w=; b=giZgIw5hopQlDgtKbM9riyJzJFH2CshUYM5a8ilw8GDfxO7fvnRIz35dV6c4S9ZTGP g5Zvu4KLohGXerp9aeGi+jbrrm+jCMZabZDXciO4MIoPWXYB1UIij6xYX5Lj6QFU6pmD Rly5Uhtv4nF4j/MrhREuxYLanN5W7OTxFyVpoYScAjoeBmjOi+txL/N61zFkYpGlt+BT Yv56xufsafyun7YT4Vw61HblXzta/YJsyleo8Zb2aFpaEieWkXXWkO7ESQ+Aw/8iwdr5 b1e5VJyB6te6AFCfj3dk04MI43HP7HL6vUjIYthqeZrOn2N4Kxz0w5ZOfOYm1i2laqhV gd6A== 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:in-reply-to :references; bh=WRpu/B/BcLywABR29mrWPu2uoAJ9/VJSM0fTjNe1z1w=; b=aD8aBPpYuqwkWOfuskHMsxQlJgTBIWtbPCp1k1OIBt7xKHo85ITS3NfvgKgvS4c7+c 027eP2SXX2W/oP3usIKb576IPqF8zu61LZgsPpzC2HtKvhZ+qqGN/ucsbUBr1/qtXNAR bCmTS5wApgjoWwF3aQYhCCqb/E0A+J8trKOqR+abQ6m9nEekSX6CZhlIJMNQmwj0sMFw Dw2uLY2W7OnE6i5z2B7BlD1jxjrnMjLtK8XavgvyBugzviGD2ONCSHRZQXCVsLRJJEco K7zMyxmrMA5miq/uX5iyXs5l6tUioqf6hYlV/rJRe+4NlM5lxmJm0jTx0PPTuvcGr+q1 CNFg== X-Gm-Message-State: AGi0PubS8XsGlRIpQO5OsRHM3bqf9tIsIOTHrk5QE17UWTfkJDH5I35l i8hvEg9N0VV0HeyD8+dwJZxsWCDd X-Google-Smtp-Source: APiQypI2yjL9CchUqrZhpUBsV1FmNVI/ikALh8gb1VWRhyjQJx8cXksbomADqp9p5yVUDPC1mcfphg== X-Received: by 2002:adf:f30c:: with SMTP id i12mr27356377wro.426.1587505129723; Tue, 21 Apr 2020 14:38:49 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id t17sm5372085wro.2.2020.04.21.14.38.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Apr 2020 14:38:49 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, ying.huang@intel.com, Wei Yang Subject: [Patch v2 2/3] mm/swapfile.c: tmp is always smaller than max Date: Tue, 21 Apr 2020 21:38:23 +0000 Message-Id: <20200421213824.8099-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200421213824.8099-1-richard.weiyang@gmail.com> References: <20200421213824.8099-1-richard.weiyang@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000003, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: If tmp is bigger or equal to max, we would jump to new_cluster. Return true directly. Signed-off-by: Wei Yang --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index d203cdc6750a..bc435c2eb916 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -647,7 +647,7 @@ static bool scan_swap_map_try_ssd_cluster(struct swap_info_struct *si, cluster->next = tmp + 1; *offset = tmp; *scan_base = tmp; - return tmp < max; + return true; } static void __del_from_avail_list(struct swap_info_struct *p)