Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp35856ybz; Tue, 21 Apr 2020 14:41:09 -0700 (PDT) X-Google-Smtp-Source: APiQypKs9z1N8KYSIPqJLEGmf0xUSySpXC2FlDnV9mHgHaPhRmnAj2svpGSH+FXOmAV/Z47SORZh X-Received: by 2002:a17:906:4c46:: with SMTP id d6mr22837837ejw.257.1587505269795; Tue, 21 Apr 2020 14:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587505269; cv=none; d=google.com; s=arc-20160816; b=hqcn0BUTcUpZg71k8l6pZl0ghnGdCL5Ha4Q0nPmpv0FQtoTwbnOivGlUucgSoFICHc 3TSkB2CrJTjKtNn96749OJunmBds7f7/Ij/aOGDcOulU+FaRp2bqYOySOw8L4WGuhddL I5JmFUzSYGlZCl/8N1zzao9YkRJbdKZeV33cHdNpkrnWSEEDbmlZLU4cOuPoXsp67r53 T7XLjm1wR4gCebKc7w8Tq3QBVroePmJCp29C/art1aPnXHjTKnh4lIsjPymgTav4tYs3 QOMkC/+ZDVTR7rKwOOxnO6Vri1DWgj/hqfu0NkkM9XqpcWi+70jktuiVY1dUMQmalmvN V86Q== 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=WRpu/B/BcLywABR29mrWPu2uoAJ9/VJSM0fTjNe1z1w=; b=DSTK0gAjx37VrcIK93fvqvOlqKyNPXWptMjJfHxM32M9CfVQ2XqeXnmv/WC02oEH4u fYA3U+AbVCGEfa8m6aGDxkhhxq2wIOksYIrcK3H1qgnzWQlQ4oGFN/w4fx3XDJbYf/th yzykIkoHX7am4AD+Be024RiWvcu5489ANdjX1j/Wx+XzsY1148ouBI6RvujcEIQq92Vv NusAaCkUhQ/In55vaRkvdLwihF9CkYLJn9YlrMUccjDsn+e7SWuIbZf/eKuQ83ulhGcf R/+jU7mKI2IP0fCBvqOLqdy/7GxhbYsGY79NHSAORK8jBnoNBg8M8lrX/hHHk+pQtbQC STpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=giZgIw5h; 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 pj27si2531935ejb.196.2020.04.21.14.40.47; Tue, 21 Apr 2020 14:41:09 -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=giZgIw5h; 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 S1726261AbgDUViw (ORCPT + 99 others); Tue, 21 Apr 2020 17:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725850AbgDUViv (ORCPT ); Tue, 21 Apr 2020 17:38:51 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED670C0610D5 for ; Tue, 21 Apr 2020 14:38:50 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id u13so11496wrp.3 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=ESBPiM8mPYJvHjFSSjXl9wYHyEXJMA1kWiWrmfVF93+i2IveqBwj4il7ESYV68Np7l ulW9w2iSWaIDSWDjrE+HrZPYxdlSe37zI6GH8007I+YWg1TCeVcAwOQ5YU5OsiP3aFyn ICE1SjQQihZ6nKFGkVVzji0z5wiAW0jbd5VpYDYtI4MX2sE0ewuECCy+zdPm6OS7XE3o orc9+d18fAM2SRnQO26EVbc4ilmBWwtR23+pRrGoV/HQLVWj5OnSZMrKbLXFJI3ab9VK 5L3uc73jDgzsq9fxvf9ZpQDoS6hji2wEcbrQbzv9VGwYzfEty7GpuGkVFi4y6VMOYjKQ QsYA== X-Gm-Message-State: AGi0PuZmSX9qpSuLSMNm/rofc7wqeXikELKbsmD9PSibflX+Bp7tsyUV 4fNqVuCpYCzjyfXsGSvlKPU= 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> 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 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) -- 2.23.0