Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31909792rwd; Fri, 7 Jul 2023 06:14:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXD2GHoQgoSuj62odtJIXzxEqlxLDNttonNynUZD54cd7bfOuBidYsGrCY6MuOYm/cWrZR X-Received: by 2002:a17:90a:8418:b0:263:1f1c:ef49 with SMTP id j24-20020a17090a841800b002631f1cef49mr7953607pjn.13.1688735686218; Fri, 07 Jul 2023 06:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688735686; cv=none; d=google.com; s=arc-20160816; b=KZFqBk8Ys4n00VDkF0ezP+P97H+fOvcOEupdDCAlp6F02LEIdwIupoIL2nQpR5qbKh KaUfmJxcbb9ONAtGmEPWaFg00xgAZJLT9wwuUNAISIUM4BSu8aIdNsZZ+r4ShcapWbN7 gOcTl7xPTLZoRbHAQQ317TybEI/APP4Jo0XI0Y57w95oQFAKAluCxWSZqMyZPaJt72KB 3xbza7ahZXOBruJSo3cPRYUPJQtqs0ppOD8tbZwpssgA1/t0gJGRBDaW+96M5gMGA0gt JL2Otc8WNUfYFQuDVfma9qPRqTeDZK/F8cZOUcPU2r8n1YnP+XmMyF4AUr4I4q4Vs7xF cbuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=t1O9zb5GHKVELS5klWqCpQjcxJWJEqyoSLzfvfMUZe4=; fh=JFh06cseEWykJOyW7rqDQuQTmKucUOCKf0clpziiyVs=; b=fzIa/IRXeKdfcj6/0jWIEr0i9ZKxo4RwkoP2BG0bLic6WisvYasOoJp6UQo0hHmBxr sr9FD9K1Jyl5uspnwS8sbDT5O8E8Lr2GuNyPX0a9Llacm2evRtpMa9pnxK5fNyQEJZNB Lo4sFCELeCP7b9HudF/BvSTZAm6BwjoZANovaVpma9PMcr2Koub5SL9wZQiqp6m8C9tr s7BNbLKaQiLoPz7L8mEm3gXmB2UpfSNDOB5+/bb6goGydmPhnC2Lcdgb6ke6FI0wfGIY riZtbzpgFHytap4v+cheG3O6nNkTOeTJPCmlhRmXrYjcmEJctmwVvchyuPbtbEUogMoG i0wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cTm1fbBH; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me3-20020a17090b17c300b00262e5a82047si2270765pjb.44.2023.07.07.06.14.33; Fri, 07 Jul 2023 06:14:46 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=cTm1fbBH; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231284AbjGGNL3 (ORCPT + 99 others); Fri, 7 Jul 2023 09:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232010AbjGGNL1 (ORCPT ); Fri, 7 Jul 2023 09:11:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B25A1FE9 for ; Fri, 7 Jul 2023 06:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688735446; 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: in-reply-to:in-reply-to:references:references; bh=t1O9zb5GHKVELS5klWqCpQjcxJWJEqyoSLzfvfMUZe4=; b=cTm1fbBHdtnLhcbGYhOVJzsKdTck8QSCVl3zmmGT+AIKbejtSjvixN/b9dA4KDJuBE56CN Q05ki7LrgmA38a4ygiJof4qnZNmw1L2Iar0LMwHWEUifUNhH085OsOT3GpUtY+Apa+sdHc LRut0gZEnhyfirFVSAuMfvFGrunpNLM= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-dwTXcIFWNEquJ2x97cQEiw-1; Fri, 07 Jul 2023 09:10:44 -0400 X-MC-Unique: dwTXcIFWNEquJ2x97cQEiw-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-63656624620so4001386d6.0 for ; Fri, 07 Jul 2023 06:10:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688735444; x=1691327444; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=t1O9zb5GHKVELS5klWqCpQjcxJWJEqyoSLzfvfMUZe4=; b=XPgY8ozwjlH+g00VrPEJhoQFcCCaetc1m3eYQMkxm83KGriYroA4ChzykM4gTHIfG7 Bdaewn/EuAxc+2QrZIqTliTrfQZc2gOQzzEcL3Akrzco3L/A0EKzk/COdaOf0QUIaYqo XpDnpt2mWTbB+JwqOtNimke8G+apbkFCZjs33cosA9bmF/l4DGFNt+5fzWq9SgkxFn+g 8v7Wa8cmSpwJ37zEvJX2/TA2aacEw1L3viAL4M/sIebQ1pw8yuB12DpG17Nt8ZRzS1cD RI4qDHrVwcefJLlLhrLUK/1Xe5kUOUxN2YdjAm5p19noT3pobDg1GFrjeSdm9Xlowx0p vi7Q== X-Gm-Message-State: ABy/qLamj8CvO8VY0vazOsfGtE2kFXRr6yZeFmYOuOP8D2b/qvwzrXV9 pnGSupQ0OTDtiwcckkYNB5jZptDEdi3zf0HvDU1NfRGCVBMTSWM29phqxW8ncA6cUawMRDJUN+L BLTVNMDXg7DUqh1v7YUZCN9mM X-Received: by 2002:a05:6214:b65:b0:634:cdae:9941 with SMTP id ey5-20020a0562140b6500b00634cdae9941mr5244166qvb.0.1688735444331; Fri, 07 Jul 2023 06:10:44 -0700 (PDT) X-Received: by 2002:a05:6214:b65:b0:634:cdae:9941 with SMTP id ey5-20020a0562140b6500b00634cdae9941mr5244120qvb.0.1688735443971; Fri, 07 Jul 2023 06:10:43 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id p8-20020a0ce188000000b0063757aea986sm2066436qvl.28.2023.07.07.06.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 06:10:43 -0700 (PDT) Date: Fri, 7 Jul 2023 09:10:28 -0400 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Andrew Morton , Brian Geffon , Christian Brauner , David Hildenbrand , Gaosheng Cui , Huang Ying , Hugh Dickins , James Houghton , "Jan Alexander Steffens (heftig)" , Jiaqi Yan , Jonathan Corbet , Kefeng Wang , "Liam R. Howlett" , Miaohe Lin , Mike Kravetz , "Mike Rapoport (IBM)" , Muchun Song , Nadav Amit , Naoya Horiguchi , Ryan Roberts , Shuah Khan , Suleiman Souhlal , Suren Baghdasaryan , "T.J. Alumbaugh" , Yu Zhao , ZhangPeng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 1/8] mm: make PTE_MARKER_SWAPIN_ERROR more general Message-ID: References: <20230706225037.1164380-1-axelrasmussen@google.com> <20230706225037.1164380-2-axelrasmussen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230706225037.1164380-2-axelrasmussen@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Thu, Jul 06, 2023 at 03:50:29PM -0700, Axel Rasmussen wrote: > diff --git a/mm/madvise.c b/mm/madvise.c > index 886f06066622..59e954586e2a 100644 > --- a/mm/madvise.c > +++ b/mm/madvise.c > @@ -660,7 +660,7 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, > free_swap_and_cache(entry); > pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); > } else if (is_hwpoison_entry(entry) || > - is_swapin_error_entry(entry)) { > + is_error_swp_entry(entry)) { is_error_swp_entry() made me think whether we should call this marker as ERROR at all - it's too generic, is_error_swp_entry() can be easily read as "this swap entry is not legal". Can we come up with a less generic one? PTE_MARKER_PAGE_POISONED / PTE_MARKER_POISONED / PTE_MARKER_PAGE_ERR / ...? We do use poisoned only in real bad physical pages before, but I think we can still keep using it when applying it to a pte. I think it's fine to call a pte poisoned if it's not legal to access, just like a poisoned page. > pte_clear_not_present_full(mm, addr, pte, tlb->fullmm); > } > continue; The code change across the whole patch look good to me otherwise, thanks. -- Peter Xu