From patchwork Sat Mar 28 06:05:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11463413 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 CFA4892A for ; Sat, 28 Mar 2020 06:06:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 91F7B2076A for ; Sat, 28 Mar 2020 06:06:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aELxUY45" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91F7B2076A 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 8D3A56B0010; Sat, 28 Mar 2020 02:06:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 883676B0036; Sat, 28 Mar 2020 02:06:11 -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 7C7B26B0010; Sat, 28 Mar 2020 02:06:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id 5F6666B0010 for ; Sat, 28 Mar 2020 02:06:11 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1ED8A180AD802 for ; Sat, 28 Mar 2020 06:06:11 +0000 (UTC) X-FDA: 76643735742.08.spoon02_53121f59bc428 X-Spam-Summary: 2,0,0,9487d0c0fdb9109c,d41d8cd98f00b204,richard.weiyang@gmail.com,,RULES_HIT:41:69:355:379:541:968:988:989:1260:1345:1437:1534:1539:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3871:4250:5007:6119:6261:6653:7558:7903:9413:10004:11026:11658:11914:12114:12297:12517:12519:12895:13069:13161:13229:13311:13357:14384:14394:14687:14721:14819:21080:21444:21451:21627:21666:30054,0,RBL:209.85.221.66:@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:none,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: spoon02_53121f59bc428 X-Filterd-Recvd-Size: 3284 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Sat, 28 Mar 2020 06:06:10 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id m11so8437075wrx.10 for ; Fri, 27 Mar 2020 23:06:10 -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; bh=1YpAucpKgiwsoc4RW0hi71eNpwhZyorDjKoSzESyn5s=; b=aELxUY45UY6a2HgB3Gu9lZjc1ZKjXWZ0I9KmfTjF+I5sDAzeXDDNF7wUqCNDYry6w8 th1J9PJ3J7k15x5nSY4JrETpO4aMgWM+QfXEft0b+CxpiHIAhT9K9FuWMEEx6KVynItl fJWWKeDh5ijhSfycEqfAN2vqaIw1jNo0TsZN8REBR8+P8MrVeoMLk5TeGKVl04c4uoId HVZvmQ0VP/L30j4X3H3zgph0TrzPFpX7btyaJLCn84zZBGhdMFjd3zesCG9qltClN1Xt gxcLqo6RPcz3H40fjNeA75Zd41l6yHhK8X7B481xZAT2on34l60In4MZiDvqIeIZN6xy RExg== 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; bh=1YpAucpKgiwsoc4RW0hi71eNpwhZyorDjKoSzESyn5s=; b=DvBh/xy1oukuk4xwPpURp+gvXvs6nvoPwd1VpfXcEpRg9VV3xEJCk9+IvFClKPiHwA kgybV9jzcC7XJEiAnpqoQhwvxov+L2WynnXrqteY30VgitmbtCEcm7mMuTscc8GNuVNG yLRHcXIW7QCJp3VBv3jvu2OAIIeJkVoHzRO856fIE/3yPMJIaBUFuTRyqqPWSE0sklMe sunLMcE+HxGb8zjv32Dj8CHH8ICCNXVX15ZZ3vLUlOB9yP4JxNau8loAhusCsjK3jdMx zUXc6v4lfFdmkz2luwR4LT/Llx9rQh5rlMhUp+EyO5eKG/VunsZDwTV4MhMWhMNv4QtP JddQ== X-Gm-Message-State: ANhLgQ1+f8Q7yrJk7Ct0UlYqJH2exZ/YVIFC3tqlI48wFd1a1nkXGL+9 lWxl5lxRqBTlsGeVgnyhItQ= X-Google-Smtp-Source: ADFU+vu6vjV33VVdjf+qxlHn4Yk1kuurtfoG+YBKbXsdJZ9JsxYuI9sHw4tUXbEobubzDBM/5HuH6A== X-Received: by 2002:a5d:54cb:: with SMTP id x11mr3419049wrv.179.1585375569441; Fri, 27 Mar 2020 23:06:09 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id i19sm11273194wmb.44.2020.03.27.23.06.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 23:06:08 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 0/3] Cleanup scan_swap_map_slots() a little Date: Sat, 28 Mar 2020 06:05:17 +0000 Message-Id: <20200328060520.31449-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 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: Function scan_swap_map_slots() is used to iterate swap_map[] array for an available swap entry. While after several optimizations, e.g. for ssd case, the logic of this function is a little not easy to catch. This patch set tries to clean up the logic a little: * shows the ssd/non-ssd case is handled mutually exclusively * remove some unnecessary goto for ssd case Wei Yang (3): mm/swapfile.c: offset is only used when there is more slots mm/swapfile.c: explicitly show ssd/non-ssd is handled mutually exclusive mm/swapfile.c: remove the unnecessary goto for SSD case mm/swapfile.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-)