From patchwork Mon Oct 24 20:48:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13018119 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 02DF6C67871 for ; Mon, 24 Oct 2022 20:48:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48E3C940008; Mon, 24 Oct 2022 16:48:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 418AF940007; Mon, 24 Oct 2022 16:48:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29168940008; Mon, 24 Oct 2022 16:48:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 15D07940007 for ; Mon, 24 Oct 2022 16:48:36 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C872BAB013 for ; Mon, 24 Oct 2022 20:48:35 +0000 (UTC) X-FDA: 80057031390.25.5477A1E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 69D9410002B for ; Mon, 24 Oct 2022 20:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666644514; 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=JQGL1jLTE4eRZpodNbuy8I66zGQdLeMOjp5jA6UyMm8=; b=e/T7wHvlbYkIKdMQC6t5ZgFEIyb+nJ9xBvrOAOhHdbkmd/+dcP678hvkwxyIyJ2RS3Vln6 ksJd4s6xGNeSK2f+FbWukroKWowq/i+v5uGd0OEodcdN/mGwWtfyHGpAVGVWsJ251+Je0i 1sZ8KlK7T6xLPZWs2+SqPLlQK7x8Beo= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-422-4Ln8y87qOQaENGixpfCmmg-1; Mon, 24 Oct 2022 16:48:33 -0400 X-MC-Unique: 4Ln8y87qOQaENGixpfCmmg-1 Received: by mail-qt1-f200.google.com with SMTP id f19-20020ac84713000000b00397692bdaecso7845555qtp.22 for ; Mon, 24 Oct 2022 13:48:33 -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=JQGL1jLTE4eRZpodNbuy8I66zGQdLeMOjp5jA6UyMm8=; b=PXEXjWYmjE/KRU1gKXqCVKHi4tSMqMpJOwvB9t+4yctFdBCLIXC/t6mEImRt0RLY5H 4cb2YxQ99G0mDhnbB3pu/hZyGCHbKXX4Bs2stH5h1gmvvPJUo7qNZgLGdjTAG8HsEfI1 YFfjuML0T2TDHe6/iNZYSv+9PnfvV4TiTMqN4ifCJkoZbTKNO7z6m2ppyDd6mPUOErd6 YhByIhYWa6N7OybElFsdYTFksXPAiGqKdLAMZBiljaF7PsMdDBsRgkjYJXzyKQFUiEjW hLKb+0YpX36VlxESIptW1iloxh0YSzBO5PA3GIW0p9N2AAvNCSBEpNvSH24QI0Q32TBs uAHg== X-Gm-Message-State: ACrzQf1gHSgvatQrMSIlvfrUGFUuP7SZ8jDcGjIbBILXvcLR/ooP+MSJ UpKf8SMs+4bzM12UKKxiCIVibrRCk3Uosfvt6F5jjiIeFTE6S+lKUu+svUyjS7/BooVrrmIA87t S924gi7Obqrc= X-Received: by 2002:ac8:5809:0:b0:39d:db1:895 with SMTP id g9-20020ac85809000000b0039d0db10895mr19877746qtg.440.1666644513182; Mon, 24 Oct 2022 13:48:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kiaYHseH4qUmhdGwaMcoIvbNsE6lTLOG+iD7P8kRX5rpK3l1TOhSQyMDRCMFRdnSqlNtFFQ== X-Received: by 2002:ac8:5809:0:b0:39d:db1:895 with SMTP id g9-20020ac85809000000b0039d0db10895mr19877721qtg.440.1666644512931; Mon, 24 Oct 2022 13:48:32 -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 d13-20020ac8544d000000b0038d9555b580sm498531qtq.44.2022.10.24.13.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 13:48:32 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Huang Ying , peterx@redhat.com, Andrew Morton , HORIGUCHI NAOYA , Miaohe Lin , David Hildenbrand , Andrea Arcangeli Subject: [PATCH RFC 0/2] mm: Use pte marker for swapin errors Date: Mon, 24 Oct 2022 16:48:28 -0400 Message-Id: <20221024204830.1342169-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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666644515; a=rsa-sha256; cv=none; b=G21xZlcM6kCIB9hCviwjS6Ypmr2szSOQ3IL08+lPLT8csc7Xko/Y5OZgvPVqHH0u9QcDdU 88BjZbIexq2X+o3rf6NAGCP0c2q0RDK9gQWcmrvWCcx2q/eYAHUTCj6R2p2kBe69irE04y Ly4v8toH5MnuJk8PWMJU6EhS5fS7IIs= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="e/T7wHvl"; spf=pass (imf14.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666644515; 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=JQGL1jLTE4eRZpodNbuy8I66zGQdLeMOjp5jA6UyMm8=; b=DFrCbzaL8u8oah6R3VuoTyJgXdbvsLje1A+EFSlyP1w3UY3wXwFFh3hltLLnQqfAgUmYKk XkPP7DyaUroqMQiRmPYuqkCezmRiVKeIUu2HyQEISCpEtQ8oVKBcd2JWhvT2FGddC+XXDJ jlEWcEYJDwjCmHEhWW0ElZ1hllEW8mQ= X-Rspam-User: X-Rspamd-Queue-Id: 69D9410002B Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="e/T7wHvl"; spf=pass (imf14.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: xxcut1q48ddmbydgs4rf7uadbs69qkhh X-Rspamd-Server: rspam03 X-HE-Tag: 1666644515-909611 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: Hi, This series uses the pte marker to replace the swapin error swap entry, then we safe one more swap entry. 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(-) Reviewed-by: "Huang, Ying"