From patchwork Thu Dec 8 18:02:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 2785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp344868wrr; Thu, 8 Dec 2022 10:08:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7al1UXPBt+sAuFh7LUyksyZ/CR5yrU+FeyjgIAMulkYBdbTGpAcBxOFti3ENdGvakyKvQq X-Received: by 2002:a63:eb16:0:b0:477:5f10:204f with SMTP id t22-20020a63eb16000000b004775f10204fmr68224897pgh.144.1670522919280; Thu, 08 Dec 2022 10:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670522919; cv=none; d=google.com; s=arc-20160816; b=xhDwkmOl9NjBry3paHA5Q/oukC7NKBDoHuSa1DsmwzC6dZOi8/kQ7YA4QcvmoIMlAE u2wBbJ99GDc57v+lEJTHonMOTTTSwZZ5+kCtGHQRCmdc4IfB4I6XfoGgDiIcPwAKHbY+ /zyl5v3up/AXQBDaABOejYAMa7AOi/gYqzMT/fsxB4eLZ7qyMjKeLJfIYnG82LzKjBiQ kDxSKX9VWk4nDAm+VEVHk/Akpqq/ribODrDNYC6p+v9fwRDdD1M38mNPvLdOENEA8pE5 grLodejCDzg9Z5Lz49EO9jN7lLTzmDFWErK8vfJObiCSxX6RfgKz8slvGm5IE6e4jW+b F17w== 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=ljb95iV2S47yFqe7M/P8twoED+tVhYFBm2hBkjjyeIA=; b=QGYT1ueBhUvIGWmu6magypYkoyjCMnKqgKABl/jvvzIIp1mWpcXqLXkDYUqumfBTkI O9fMvrY8cr4EOODLpJ+4ApiXhqaxQwi6K9SJRBvTeSaqFNVX8+ai4hXJAeDn1ZX0vTE0 3Yo7shfVApqOVGDvJZIOtfcq0lZqYU+PDzDj4woHmO8AftQZ5OLJxLXw5MI5neilVKsA z72AVl/ARVQ79n6/7BxgnepGdEEPvJZV/YUeGABYQm1U3lZddP7iDxS/jmcZqXJQbkLb I05tAV5RBNBiDVFv/DBkKiXbD9GbJXdq+W6mnx23J1/JCSupdj6Z/KbZ50YMIsnjjRg7 WCPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a7zzH5IV; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u189-20020a6279c6000000b0057629288720si20655004pfc.176.2022.12.08.10.08.25; Thu, 08 Dec 2022 10:08:39 -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=a7zzH5IV; 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 S229781AbiLHSDM (ORCPT + 99 others); Thu, 8 Dec 2022 13:03:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbiLHSDL (ORCPT ); Thu, 8 Dec 2022 13:03:11 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B06D43D93F for ; Thu, 8 Dec 2022 10:03:10 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id js9so1308570pjb.2 for ; Thu, 08 Dec 2022 10:03: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=ljb95iV2S47yFqe7M/P8twoED+tVhYFBm2hBkjjyeIA=; b=a7zzH5IVhSlqUV1f3wxFN1w4gxYVvptThMs+6ClgGLMen6dx4HjWmNYpT6Na1cVdt8 +G94ov1eGOViFGejZ9Ck6xLXODIXAGZ2oH5LiAUk3j2POI7WzfkgZrqv03GO7VvmBqtc vYYtc2MConieAtU21n+Ce0FhJIyw+MiITecxbankO3UNZIp+qekQnSrqNSyq6N+CwUO5 YcXuub28iQZ+RKoGAFz7RYyi8kp3axpTixnhspQF2x35B9nTu1mvAkVbvKCUn6Eaxr+4 SM6JZ2+BDIgDaL+UJkkcjhU+xQKFCXdv6xhqbUU9fxcWSRFXtuhhVyWpbTq76UCxcTwZ Oveg== 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=ljb95iV2S47yFqe7M/P8twoED+tVhYFBm2hBkjjyeIA=; b=HrOKjaZ2h/bAeR06gjqoSsW0hBgP1MeT2ugYCz8BtJBT0WARqnyPnSKFBJwATiINkL cOE6Ll5Fmc+sdAhFaqKioWCBTR45gTFcifMepdLPtueN0fvUVG9Jqbh/cKyCwB8SReM/ i7eXe5+vN32e1Evx12PpmsmtVVRoS/Dl5/xvWh6b4mSV69IEfwOjaJdg1+dohNTUPAcs rhfBPBAqGRvXBiGwfT3XF2dnR/hg2+VHDB+1kRrTNUTLRzsGRgWN0fKYGHjOcUNHU+NB DjL2b24PQDoCcGK4/y+Ohu/DL6+kvyy5j1nUw5KMhKVl/v8iQSxIh4I8DqPSBeutLPOp FPGQ== X-Gm-Message-State: ANoB5pko8+6XNyLDKNkitriGEV1rqJpmazOgVuojCm2nqrpgrIwq+GBY 4lIxiI4ObZIm5ks3x4brogc= X-Received: by 2002:a05:6a21:1690:b0:a7:99c4:80ec with SMTP id np16-20020a056a21169000b000a799c480ecmr3696639pzb.20.1670522590145; Thu, 08 Dec 2022 10:03:10 -0800 (PST) Received: from localhost.localdomain ([198.13.51.166]) by smtp.gmail.com with ESMTPSA id x23-20020a63db57000000b004785e505bcdsm13377909pgi.51.2022.12.08.10.03.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Dec 2022 10:03: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 , Kairui Song Subject: [PATCH 0/5] Clean up and fixes for swap Date: Fri, 9 Dec 2022 02:02:04 +0800 Message-Id: <20221208180209.50845-1-ryncsn@gmail.com> X-Mailer: git-send-email 2.35.2 Reply-To: Kairui Song MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751670240736938072?= X-GMAIL-MSGID: =?utf-8?q?1751670240736938072?= 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. Kairui Song (5): 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: remove the swap lock in swap_cache_get_folio swap: avoid ra statistic lost when swapin races mm/shmem.c | 8 +++++- mm/swap_state.c | 66 +++++++++++++++++++------------------------------ mm/swapfile.c | 7 +++--- 3 files changed, 36 insertions(+), 45 deletions(-)