From patchwork Sun Oct 30 21:41:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13025228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFE15ECAAA1 for ; Sun, 30 Oct 2022 21:41:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D36B6B0071; Sun, 30 Oct 2022 17:41:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 383566B0073; Sun, 30 Oct 2022 17:41:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24B2C6B0074; Sun, 30 Oct 2022 17:41:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1260D6B0071 for ; Sun, 30 Oct 2022 17:41:57 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DC612A04FF for ; Sun, 30 Oct 2022 21:41:56 +0000 (UTC) X-FDA: 80078938632.06.EEDA6B8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 7CEA880005 for ; Sun, 30 Oct 2022 21:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667166115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MgVI/NJmz9bHNl5fyvWvLupv11bDXKEB94mkCaXf69A=; b=F+C+mi3tkZbOSHkxDkNtOltHapPZ+WuzSBMxe4W2siS8KdazAy279d/99PzP6O/mhmIV5d ZKzbK19ox5oH0bNnTJURf8iX3OVEIDBQSbSQc2raU+8PmhTJIZKmLBmAu6cf9YZOpHgyqx fWXN5wsUZAUxKMkyBDDQnhI4CNUto78= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-657-HXec4LiZN1-cdIfw9qLpfw-1; Sun, 30 Oct 2022 17:41:54 -0400 X-MC-Unique: HXec4LiZN1-cdIfw9qLpfw-1 Received: by mail-qt1-f199.google.com with SMTP id bz12-20020a05622a1e8c00b0039ae6e887ffso6490049qtb.8 for ; Sun, 30 Oct 2022 14:41:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MgVI/NJmz9bHNl5fyvWvLupv11bDXKEB94mkCaXf69A=; b=w6TApkNCpClcPW6b3pixzz+/BNM4dl0nohKZeutCO3LXIcvD96Yr0yrOjCQRp0GtHn RspP/2/9iDlJ0H6e6WTbICi3OIW9JPMGPhdtpt+7mNym/SV47QpQl4+n50Rl8yZ1Fs2x GvHkucyL0/EfWn75Tjv03pX54cMvzgD/qrm1wAQyz/JdVnT+DxlxJeRBx7tnrVM93/e0 ivqLUyRukPIbSYhANuzORu8VkBL4kvSf24N2Feu3CfOZFpkqEHuu9xw+lyrSEhlFMoLF iMDO5xMRxT7UVzYvDSmVkPDHLIfqwdti3RjS++EbuZe9Sl+cc+22HfRWvKEZIzwtDD8d e76g== X-Gm-Message-State: ACrzQf06acJTaId/jUfbQuMXE3rwW46aj0Jqtk4KENAukLa8pHGqJpzN ox2fOyVi7oFI6r20QIMX3B2RYjDpEV5k4b7Pw7BHQ3DQtmDDYSa5rLkD6boZa1bEXONODs010iC YjOv+ejnyFdA= X-Received: by 2002:a05:622a:14d:b0:39c:c531:2506 with SMTP id v13-20020a05622a014d00b0039cc5312506mr8311634qtw.13.1667166114151; Sun, 30 Oct 2022 14:41:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4HxJvZ0hL772t1OEj0fcNR5zBHfX/VDSOY6kS6G8fDh08MXBBQBY9OgRo+06XQms03A0QKaQ== X-Received: by 2002:a05:622a:14d:b0:39c:c531:2506 with SMTP id v13-20020a05622a014d00b0039cc5312506mr8311623qtw.13.1667166113933; Sun, 30 Oct 2022 14:41:53 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id az42-20020a05620a172a00b006bb87c4833asm3506450qkb.109.2022.10.30.14.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 14:41:53 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Miaohe Lin , Huang Ying , David Hildenbrand , HORIGUCHI NAOYA , Andrea Arcangeli , peterx@redhat.com Subject: [PATCH 0/2] mm: Use pte marker for swapin errors Date: Sun, 30 Oct 2022 17:41:49 -0400 Message-Id: <20221030214151.402274-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667166116; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=MgVI/NJmz9bHNl5fyvWvLupv11bDXKEB94mkCaXf69A=; b=cT1kNqVgsqm35atYu7FqsyuBbR5IDPuSmXe2NvCXO34v3Jtq05PAdPmKyy3Qy18fLHjpdT HuglN8mEeCYjZcpkgqAPQ1tqZF7eGr25b5wIkBtFGYjk2DopNq336GD+cOx9J4fWit2cxj s/B+r0eCHEU09j5mbUqRYLu35KWCt9Q= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=F+C+mi3t; spf=pass (imf30.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667166116; a=rsa-sha256; cv=none; b=GzBzGEOMN2UPyMgHU6VvkVGKPZyauo1o8d77KDvyZHb7IPoyGnKzLFuW6LioO4pbEYu8CF I91X08icIbx75+w+JfuSnrOoXQPKqKbupqgN3tfT1cEpC4/S3t7afiacpKGCPNfyHKIHZd CDuoznzHBJ0Ct6YCbFtf0c55JAODMa4= Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=F+C+mi3t; spf=pass (imf30.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Queue-Id: 7CEA880005 X-Rspamd-Server: rspam03 X-Stat-Signature: kdd68m5t9uepscueie6nqjezhw89zysf X-HE-Tag: 1667166116-255970 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: rfc->v1: - Rename SWAP_ERROR -> SWAPIN_ERROR [David, Miaohe] - Added r-bs for Ying and Miaohe Hi, This series uses the pte marker to replace the swapin error swap entry, then we save one more swap entry slot for swap devices. A new pte marker bit is defined. One thing worth mentioning: we need the pte marker to be always built to make sure it works like before, so I made an attempt in patch 1 to drop CONFIG_PTE_MARKER and always compile pte marker in. Since pte markers are enabled in many distributions by default already, meanwhile the codeset is really small I assume it's fine. But still I'm tagging with RFC for this initial version. Smoke tested on anonymous mem on a fake swap failure. Please have a look, thanks. Peter Xu (2): mm: Always compile in pte markers mm: Use pte markers for swap errors include/linux/swap.h | 16 ++++---------- include/linux/swapops.h | 49 +++++++++-------------------------------- mm/Kconfig | 7 ------ mm/memory.c | 13 ++++++----- mm/shmem.c | 2 +- mm/swapfile.c | 2 +- 6 files changed, 23 insertions(+), 66 deletions(-)