Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp75667lqj; Sat, 1 Jun 2024 08:34:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwr4Oc0aASWoz+roBfg0wYEO3e/gCQ+Dqnl9IoX5YqLgXA9OTdmSYseqqnsaqeMA8eHcu2GugR8zad6E+a6t7NqmT1w307+yQF/tXWjA== X-Google-Smtp-Source: AGHT+IH8F8/nEWbKPYhhTVou614j9zrkRffKQz4k53lgL54Szk9JIoiWwjOVTigdfA47nhwj0HtH X-Received: by 2002:a9d:7d81:0:b0:6f0:5c48:edc6 with SMTP id 46e09a7af769-6f911f2694cmr4726964a34.1.1717256093823; Sat, 01 Jun 2024 08:34:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717256093; cv=pass; d=google.com; s=arc-20160816; b=ofaDFusqFbmY9P8vTWMZ1dPgJwOTiFuSnLlBGrwtlqmL9WTz7RGJ8oZcV5XXBCF58X Ufk+Ep1l8VfB+eZ0IM6W+Jw9A/OROfRYUqE6l8zfNNncQjb/M33EwPcBv9w1aJB0MQC4 YG99w9m0VKmqaJEuUW7PNKDa6O1doRAzGJ3yHStcBja1VYAlSk+9TxGBt9azgTeBtrV+ 4mLqUqfmCa2hXcXDKgWSgI/lLUTGd2PJ0ZeYjDwd4ywJIuAWXbm0NXvRLU/aPAJ5rW/O njRGTNtm2klRH/jC2fuo/uNdTnW0h5C4feHevhI3XgkhNDuSMdDbbLYhwcE2ZQ7efBwy SFog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=2QacpLrWBt2KXDo0hOhXCAz+jwCknJSRzclX8saHx00=; fh=2HVq44BU15QRiTQOYFqeepeSDxIf0vXvzW9oaNRwAiw=; b=Q5dFjpCh0gLK7CQNmwY3Tdw9FR8Bw2uiux0pT3e5brgviBcdTd7OS41QZNArkUDvQY pz++iUa+twPlBpXXNqVLD9fD4zB4gmGjSe3UAXtjoHqZGyBRWIIUn9AWYkEpxnCSRMkZ 6rPCiC4EunbOSYPsjanoHG9x7ZblF6ql3MhyNU0eST6orKtdqLGpkKY4DgTLh0h7KRUq HaC7IStcSDpEA3sgT61W5ND7DSUUyV5VdWmfoDziG+IDG7DpHxVogPoAOOCZ8OzT+iUd 7BSKetjwA6vl1rZdF3MDKxEhZzEhBJTwPEmzQZZoeP+VQDtvcEKoUJJqw4FAKcI6tRIG dDbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g0B5+T35; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-197935-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197935-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff2467db5si46770831cf.278.2024.06.01.08.34.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 08:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197935-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g0B5+T35; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-197935-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197935-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 775381C20C1B for ; Sat, 1 Jun 2024 15:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52077152DE4; Sat, 1 Jun 2024 15:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="g0B5+T35" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4E8617BD9 for ; Sat, 1 Jun 2024 15:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717256087; cv=none; b=CY2/xw5/41YSp3jJM5g7s/ZIkBr88Qd07hNFPPCBzeV+WaNqDSOmj1dz4xm7rNobY7NlkndFu0RFYW4SAZRHsEusLUkjwBc1jCbM+kBX2CszC21FFWpRpipg8/iEt1zMHYepWTF8J268KRfT9Q04Q25xbs2BaXlLULH41I/biuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717256087; c=relaxed/simple; bh=XPq6Qkhk7qdzGup1JfRdfVer0utZQJ5ZoyRpLPVLZ9Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uC2dA6L0AYDQwIt4i4Dph0O+qpnF5O4m5eDzTciiPOEzrTcjvNZIwhATyRcESdeCcGK5GJ8tF5YUrzM+5vnF8iywkKWubpCp8gjDKsc8b1zJH/i+cz8r1yyAIhcirDSbvEv8HfBppWsAtKnN5nGUZ1eeb/N/AWYZSBa4mrIM8Wk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=g0B5+T35; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717256084; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=2QacpLrWBt2KXDo0hOhXCAz+jwCknJSRzclX8saHx00=; b=g0B5+T35zr7F8fRtuM5TrPMV5DKgp1GtUVjjT003A5a4cHlWZMJAQ0JigPcKPd7UbYUQOh 1SDhArJO5MJHCi73iN+uGAVRaRIkoH1Tn46WOhg0oWpCpi+D3/rSacAY5CVt7NT+94CdoB cgQI0w4Fiq3XvEc0hJpecK+hJUW0+DU= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-458-t1PS9bhiOJyaIWxcBfisUA-1; Sat, 01 Jun 2024 11:34:39 -0400 X-MC-Unique: t1PS9bhiOJyaIWxcBfisUA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-35dca12cca8so1393354f8f.1 for ; Sat, 01 Jun 2024 08:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717256078; x=1717860878; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=2QacpLrWBt2KXDo0hOhXCAz+jwCknJSRzclX8saHx00=; b=G6X2MA1GnDO82pE8/pHxc/AfQVgSromoRM+Np0zznSWRvhZ4W5Qp6Szdt0jlpUQWqU 0Nukmo63j6CmGhpCWWu5HHPo6vURsDv+zm8MPOBLKVZiBrV7gZ5wHMQyD4L4v1G87iaA h9GeDqrhyIBF/bG2fgoJ8kvX17JwiwGTn+F0TY6oDsloEX7XK6zWfNWiP0xC9I1ed/v2 xhTTQEndwLMxIOqPpyepLpB3hhQ0na0LOh0wDH3yGyAyhxs+GVfjBic1r9xfYygfxNwr mI25vKvotrkwy9fILwKXeWvK9YE9KQcZ9nSbU/mEQOLUl6H2eLSeuLzcCvdBpnRXoqeO zSwg== X-Gm-Message-State: AOJu0YzxkYi0XSjjMU7MGErR2rmYNzKuzePUZk7tfPaP+gKkZYLdfoWU EVDmYbJi8TGUEFVJ25D9Y557sS1fB1skaiVib6wQ5QVIsgRXaFPMkShIP2gL0uKiJ94bnkdyFfi ChpE37kunrdryYqiIWZcYk6BMgxYE8Pk1Z9KUPBe55ayuJdl5+Q35NUAHP4SpWQ== X-Received: by 2002:a5d:5267:0:b0:354:f144:43e6 with SMTP id ffacd0b85a97d-35e0e5f5b94mr4522600f8f.30.1717256078351; Sat, 01 Jun 2024 08:34:38 -0700 (PDT) X-Received: by 2002:a5d:5267:0:b0:354:f144:43e6 with SMTP id ffacd0b85a97d-35e0e5f5b94mr4522584f8f.30.1717256077930; Sat, 01 Jun 2024 08:34:37 -0700 (PDT) Received: from ?IPV6:2003:cb:c71f:b300:1d59:157a:ba27:f7e0? (p200300cbc71fb3001d59157aba27f7e0.dip0.t-ipconnect.de. [2003:cb:c71f:b300:1d59:157a:ba27:f7e0]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04da967sm4263993f8f.63.2024.06.01.08.34.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Jun 2024 08:34:37 -0700 (PDT) Message-ID: <4a62a028-570f-43f9-bee2-d91276e075c0@redhat.com> Date: Sat, 1 Jun 2024 17:34:36 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: init_mlocked_on_free_v3 To: Lance Yang , akpm@linux-foundation.org, yjnworkstation@gmail.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, 00107082@163.com, libang.li@antgroup.com References: <8118eabf-de9c-41a7-9892-3a1a5bd2071c@redhat.com> <20240601140917.43562-1-ioworker0@gmail.com> From: David Hildenbrand Content-Language: en-US Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREo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I80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <20240601140917.43562-1-ioworker0@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01.06.24 16:09, Lance Yang wrote: > Completely agree with David's point[1]. I'm also not convinced that this is the > right approach :) > > It seems like this patch won't handle all cases, as David mentioned[1] before. > folio_remove_rmap_ptes() will immediately munlock a large folio (as large folios > are not allowed to be batch-added to the LRU list) via munlock_vma_folio() when > it is fully unmapped, so this patch does not work in this case. Even worse, if > we encounter a COW mlocked folio, we would run into trouble (data corruption). > > Hi Andrew, I just noticed that this patch has become part of v6.10-rc1, but it > has not been acked/reviewed yet. Is there any chance to revert it? Thanks Lance, for paying attention. I think I spotted this on LWN and thought "I don't recall that we agreed this is the right approach" but didn't have time to follow up. My opinion on this did not change. -- Cheers, David / dhildenb