From patchwork Sun Apr 19 01:39:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11497075 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 4F95281 for ; Sun, 19 Apr 2020 01:39:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 12B4421927 for ; Sun, 19 Apr 2020 01:39:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ic9YCn4h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12B4421927 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 5C0CD8E0006; Sat, 18 Apr 2020 21:39:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 549558E0003; Sat, 18 Apr 2020 21:39:32 -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 413D08E0006; Sat, 18 Apr 2020 21:39:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 2ABE78E0003 for ; Sat, 18 Apr 2020 21:39:32 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id CD1C7249B for ; Sun, 19 Apr 2020 01:39:31 +0000 (UTC) X-FDA: 76722897342.13.tax50_3610586270e58 X-Spam-Summary: 2,0,0,5d47bb9f6b077dd8,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:14394:14687:14721:21080:21444:21627:21666:21990:30054,0,RBL:209.85.218.68:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.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: tax50_3610586270e58 X-Filterd-Recvd-Size: 3456 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Sun, 19 Apr 2020 01:39:31 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id re23so4826448ejb.4 for ; Sat, 18 Apr 2020 18:39:31 -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=0z07W0i5lACCA4tx1d7PSEMm+ePwZcbmHDi4QNrUNW8=; b=ic9YCn4huKX1BFpVVvXT8DU2gGd9dOXFhlxx+eI5j2c8I66fl2T9LdK7jfq6A+6O1G g6NigPIbVwqrMeayiy1hOuVAsNSAK/syvhsRpHAcLVXTQ92vHZOMXIhTFN2rQlTPPs1g Fk0gmRH5mYwtlJ8Cb3Jk7IhBLkrMThnNerPRpsoaFPh6/9S6UiEqnN7UV55Iys++dfy0 N+kgHg44B7jxTywaF354O0y+V9RySlEotFj1cQcULPCgUoYD0fTD/WAiXjTk58xGIvDn LAyGTl+QKyn1RlgVTZRWLktRVYXJ6f1zj0ssPKGfIZzRFqntvnZ7LAgWMObcvUUouil7 fBPg== 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=0z07W0i5lACCA4tx1d7PSEMm+ePwZcbmHDi4QNrUNW8=; b=bDfteboGOPwM3iNoM//XG5dDRUJ9IXeShKhjBR0wOIC18GYk2ILycp/6lRTyZAHyJa l98KoS+u4vG45mYYX7qYm2xF81cV5GHnB9Fk7i3XqwbdOny+X7J2BZNxfQvcrTyqdh4j 5mgSAychOOou1yyIMkUS2kzgs6cKMxmjPFZWuht+djVR9B6L93kjMafHsGwxKwUMJsrU 1XApmfsqDteYgFLdksIF3F+bLyoFnnYVsA8S3htcZQ2mdZngAYE4yxZlzsoojde0A1he 3AsFkGoFoihNwXjws3tCpj1YX6RSuHgBuzDdrDqOAqtIaYImebzJCBqr/Xh5AQtcYDkM aJZQ== X-Gm-Message-State: AGi0PuZUPFYkdnuXEPXy+qrZteFTdSR9A1udmIQYpPdIccEJGAqaPowI p8QFdxgE58f0/y9mCbHbqOE= X-Google-Smtp-Source: APiQypLgDnYl2t/SpoaWdQtu4L+o6/wPL0v2CiO4qkeVDBcDEAQB5xhqxU7g3SeBX5A/86vcildY3w== X-Received: by 2002:a17:906:1641:: with SMTP id n1mr9988302ejd.365.1587260370404; Sat, 18 Apr 2020 18:39:30 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id e5sm3452394edq.76.2020.04.18.18.39.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Apr 2020 18:39:29 -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 2/4] mm/swapfile.c: tmp is always smaller than max Date: Sun, 19 Apr 2020 01:39:19 +0000 Message-Id: <20200419013921.14390-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200419013921.14390-1-richard.weiyang@gmail.com> References: <20200419013921.14390-1-richard.weiyang@gmail.com> 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: 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 654bad5173bc..3aae700f9931 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)