Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2214864ybz; Sat, 18 Apr 2020 18:42:18 -0700 (PDT) X-Google-Smtp-Source: APiQypJblOO8t0LWXtOFks05i3Im3uzjPDpDS+txyCXkAB7IZ+BkMhRQaJSNT2bfpnMleSSDDQlA X-Received: by 2002:a05:6402:1596:: with SMTP id c22mr2727272edv.100.1587260537853; Sat, 18 Apr 2020 18:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587260537; cv=none; d=google.com; s=arc-20160816; b=Scr8X66evzfMWoSRMdFuIOZWvmGzoSlo6iyzah65ggkpjLbcsZ8pkgSeU+lZDuIier ME7MXx0bCnP7fDPrcL8Q7vxF7EY+7uuryyD+Cr0Beymvw55NeOaI+omh7EJtPIYWbC8q 6j411X4cdfwVwXV5z2myaw8amcTALMzjp7SveLScaOJ1WJegOcFf9JZaSYCYyD+LAEAB IgEwUN65et7VdhHcpV8xofWLUOhI5ry+PQLqeGNO0zQKdPSJm7m6linatMqOzqRmPVsF iTCPy6FA4o+UsG+KZyku/q5NZrLbpwbBpicl4keBUoFVMP9JaKRiEX1HFh1+TyMQHsrQ 4VXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=0z07W0i5lACCA4tx1d7PSEMm+ePwZcbmHDi4QNrUNW8=; b=eAPzq4Y4V7NRG4YoTwVb7slDtbSaR1uV65kn/HiALr2vwWToD9L6qJy44voDpODu/l sPZpXq6fYUQVV7kNe6KfuXMVerXEdXGtqL5VbziLTUGJ9t/9ksnUwGmcpP+zEHp907fq YrvBvW0hIBEXSpzUbZUjkAEP85R/KpwD+KWI5A2ask8h1vfeGHWh/h+bGYPswe4bjVVg amhHko9KuU2sfJc8W/BOjW7KSb2IdqEfX2/o+x7WKHWbTr9DMvv3+qpU+Xdcz1m2E75B jEC7ZHP2HJH+tt0RExby5ua/CaWYJdAfpwvKswPyRLqC3dL022Je2O58fAX0vf4pgbkt UKBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ic9YCn4h; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si7554592edc.217.2020.04.18.18.41.55; Sat, 18 Apr 2020 18:42:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ic9YCn4h; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725939AbgDSBjc (ORCPT + 99 others); Sat, 18 Apr 2020 21:39:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725827AbgDSBjc (ORCPT ); Sat, 18 Apr 2020 21:39:32 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A545CC061A0F for ; Sat, 18 Apr 2020 18:39:31 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id n17so4815510ejh.7 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=CB9SyPOcfMX8Q9/oyjR95BeswXxjEP4Rac89S+PDGkTznZjnfyB3tUVwqe+BKBg2lq 4ZrJ8qzEZGmF8Q6KKwa6CMfMAtVWQB4vclWNn57Ek/bLZ0oWRe/6rQc1nGpvNblQb554 7Xni2lMgGRxsMdHGI0y2pVg19sE2nDQ9Ntc/Eh5IIvNBbxMxDiXRBYlblye8KHtNwN0U YgkPmYRjqQFIxkHo04wBJKjSWRTgpoq6OcW16lThed8U075wAb+ZUF77JaFudZypV7QL YbW/9pnKfeZ4jodyiLi03M3I7hHFmWB09Kq9RX0Exs78wp5b4xQkuUqT/fDrYD0bhb3B Vucw== X-Gm-Message-State: AGi0PubYA003Hj/NEijnSpL2dyjvJhB/EhZBX5UoSnZb5f9/nfdOD3lF HI+YPP41sTz/vZBOmB5W9BE= 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.23.0