Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2974720rwj; Mon, 19 Dec 2022 11:09:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hpACsUW3XLYSh6REHVCoIrubSG+xIJZCvlbojlSUH1OGXx1Eg7/Ufmh39ZXYFDiY24e/+ X-Received: by 2002:a17:902:9881:b0:185:441e:4d0e with SMTP id s1-20020a170902988100b00185441e4d0emr43356626plp.62.1671476991881; Mon, 19 Dec 2022 11:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671476991; cv=none; d=google.com; s=arc-20160816; b=F/NJEGPEZpCqEprD2iByiDLg2hh/Gp7A4/PYjQ9iCjYReZgNZsm955Bkkb2GV/w9dH K6s99TdoeFyVAkX7j1062+1CrtZUyepADJgSZ3vD8JI/PodJBM2XtVqGCjOpLByhWl6R o3gjyt9n7g1MSMxCm6vZbRHKWgUjYPNt09VraDoNRij5c0CviicfXXIUHOzxhPjnWlHJ Fxv7uhov4yXr18G14GSOsKF90utBr7bdMVLn+Q30r0DAZKpvMD3okGDEays/nsye4/yt 9sOSPik2XoRjD7O+PrsROBF6LVjIvWjBLiCbpF1xZwcb6sD8/mCZl8aJ5Ca5JUDdd6W1 6IIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hZhRIzBqxXMa6fseg6CkSAdY583EaojUpyztij/imbw=; b=NHTdzqT2rAA+wrWFQhPnS4qsKYyZIFjyQR4wkM5SD+NObR6BpPfzePMP9IGadqB1ad u47f80kD5QgLLA9KHUNPn2ibXJ+Kuzb8zBCuWbLIqmFhqaDdt+D+JNNRX9plnhUtffC2 wfdDIAwjm7upxDFzKEI1jiZWGL8KBhTzD/ONOZZE83rZkE4FXCuMmBFuBnbCbLnkRV6M Drlg6xBkOeNn07Euo3dxeU7x6vC57SVRQXG2k2mUPXC25kiAte1cH8UiyryILfhXkmzy sitaqPLaaiH9JN8EYv6cXjqHhvs3P087qZz8w2sQL+rAFZkY2Q4YAvm4BlXpjpDB+HDr gNpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L5GgSLXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020a63f455000000b004790510bfe5si11461674pgk.692.2022.12.19.11.09.42; Mon, 19 Dec 2022 11:09:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L5GgSLXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232159AbiLSTAZ (ORCPT + 71 others); Mon, 19 Dec 2022 14:00:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231783AbiLSTAA (ORCPT ); Mon, 19 Dec 2022 14:00:00 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF5032AE7 for ; Mon, 19 Dec 2022 10:59:10 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id u15-20020a17090a3fcf00b002191825cf02so9776156pjm.2 for ; Mon, 19 Dec 2022 10:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=hZhRIzBqxXMa6fseg6CkSAdY583EaojUpyztij/imbw=; b=L5GgSLXnzhMaLVMaVYqX/Ybe1XCcGXDDtaD3Zsecc+djwJkvd4W7SFk3kXZI9VL8GG fLZ0Pm7qkspJmgcSfzSP0P9e/RtiEm9XcEirRerUb632pq75N9YtQlnv7VUfmw/vSA4w bkOyL+aAJAbGH65LZ+yY4IOissL4Kj3TUlqPFJToWB/s5oFZ3JlqTnIr4VzWlPdxm4+C FFa33NoXBmU+GaOg7SWFs7lbolkJK51YJghVomJjdxmPEHEYq0TSBdSGww7r3GjCtvxi bn1/7bsHhU12L5sxiMng/lr+TToZIefy0EimnCxUelw3Makg3diT2w9IaXPb/+fmcrfU s17w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hZhRIzBqxXMa6fseg6CkSAdY583EaojUpyztij/imbw=; b=EyJ22ZsFwAQcKR28E4DbfSO/wLD/JoRTwShzNZAyK9cDRJ1AAFgbNuH/FljTMN2tKB ywzEUJ/4YGdN2IUyuJQbsVAYO+ys1fCKqgaw0TTCUa+RU5l5IRzBZnfXTBnpAVaZwbY7 51NPEqtOCjg3iPAXHsYg3ddrRxGx/1T5nMVCDiwfFM3IuTxeopxzvVpeqGXkuna62Ua/ CB7E52tdDthnIQq4FRGVQxxRktfFSXBgXHJVRAUIyyjkVQMCHDuvcHZSXocHIbSCNzJf /yu8DAu25nmzhb3SPhQyC++2ezdPKivWbXf6aAsiR3XPVLQPjdomZbHDJSHj+XOi+ack inzA== X-Gm-Message-State: ANoB5pnCaTR7fmyGVcLZ+nTlMhEfWfugozKTxxVwFbCe1ZR4qx9D574m NRcmiI7El13SO6gkS74duhBxKdGouBC69Q== X-Received: by 2002:a17:902:f64d:b0:189:603d:ea71 with SMTP id m13-20020a170902f64d00b00189603dea71mr44135292plg.58.1671476350218; Mon, 19 Dec 2022 10:59:10 -0800 (PST) Received: from localhost.localdomain ([198.13.51.166]) by smtp.gmail.com with ESMTPSA id i6-20020a170902c94600b00189847cd4acsm7480790pla.237.2022.12.19.10.59.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Dec 2022 10:59:09 -0800 (PST) From: Kairui Song To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , Miaohe Lin , David Hildenbrand , "Huang, Ying" , Hugh Dickins , Matthew Wilcox , Kairui Song Subject: [PATCH v2 0/4] Clean up and fixes for swap Date: Tue, 20 Dec 2022 02:58:36 +0800 Message-Id: <20221219185840.25441-1-ryncsn@gmail.com> X-Mailer: git-send-email 2.35.2 Reply-To: Kairui Song MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kairui Song This series cleanup some code path, saves a few cycles and reduce the object size by a bit, also fixes some rare race issue of statistics. Update from V1: - Collect Huang, Ying's Reviewd-by. - Use bloat-o-meter to show size change info in commit message as suggested by Matthew Wilcox. - Rework patch 4/4 as suggested by Huang, Ying. - Drop a previouly invalid clean up patch. Kairui Song (4): swapfile: get rid of volatile and avoid redundant read swap: avoid a redundant pte map if ra window is 1 swap: fold swap_ra_clamp_pfn into swap_ra_info swap: avoid holding swap reference in swap_cache_get_folio mm/shmem.c | 11 +++++++++ mm/swap_state.c | 59 +++++++++++++++++++------------------------------ mm/swapfile.c | 7 +++--- 3 files changed, 38 insertions(+), 39 deletions(-) -- 2.35.2