Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp185616lqo; Wed, 27 Mar 2024 10:06:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbS94rWfykb25ZDC8NItwYiWEbeGdLBdk5FWPl41G+GWBo8D1a7zNHwi55bLGPoUgTVv9AfQoG4vuVfBgiqQjDJ7+broeaB4094dzSbA== X-Google-Smtp-Source: AGHT+IH7H3jEFa84hptnWGukvYLXpBHGNuwGGoSANVf1TYOjesFC94wfnQD539jW6sA8b+ymFBeo X-Received: by 2002:a19:5f19:0:b0:512:a4ce:abaa with SMTP id t25-20020a195f19000000b00512a4ceabaamr40825lfb.48.1711559176540; Wed, 27 Mar 2024 10:06:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711559176; cv=pass; d=google.com; s=arc-20160816; b=azDcbLb05D/3jb5Vq6U+PHwyjhyMzMOdf4uc/CF4pMQxI1hAZUNfZRh/NZ496UA/cr 7Fw6SoctXFBTkBXnW2OPNV++XeuS34gCIbJwhsgTaIxAvKRNlbs2g8PhULOK5m6g9FJT UAs8nFxkWyuggONZ05qTQwuWlYXcP3yhY2BF7eS61Sq/p6rirnTp0TUQVjo9NWIqg+ls DjoJKyfHmW8nzax+1kE1eHzPqHvlAxp9PgTueOcMdfjgt3rTJJXy5CmX5LyylEHP9B9U zvyNSVEk/ag0eyxbCAbe1AK8epTnM8hoMvf7V/ZhQD1xD/wxzRSDbZDfUwXUjACWLzZe ku+Q== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=9PPCx7i0tEizVRzpeoi4x1mQBKJiyNyYCbcOnRkQ3J4=; fh=0hMj++F4liVjtX81LNPTTktM6kZFnUJ/Y893FiOAxCo=; b=rNbqMdnjOPVC/tiUatADXQc0V4p63essSzUONwz9cL6IdozOXgzIXxMWJ5ScpU16tv GPIbpJC2HoI7h8pjpEgRkAiv6p3qWSK9dqc86BmNapZHlon74DqRzC4zUo5hRovvI1wW XLWB32VNd8I/aZg8Uu8w1R/DWtSsI/JJbF7UlBEa4OrdzGJRtb860g8mptPvqS+Obu2L slTi+d/fSbUrnIEMJw/AoO0IQGfPv5w1CLwXhknvol4XMOeGHH0ebDfMJNKv5Bi1e2mn S4yiII7fcYzRfbNFd9sfOh9PesPovm8N2yjQhSinkib6dmiwEO+HiRUX3tzEPXp0e49P SBmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TpCYXb0d; 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-121665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p4-20020a170906140400b00a4df40d1ab4si1868378ejc.690.2024.03.27.10.06.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 10:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TpCYXb0d; 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-121665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121665-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 131F71F2D47B for ; Wed, 27 Mar 2024 17:06:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F42614D71C; Wed, 27 Mar 2024 17:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TpCYXb0d" 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 6D04E14D2B7 for ; Wed, 27 Mar 2024 17:05:58 +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=1711559160; cv=none; b=tJL5ve7xHMzVzNrL7989idkCNRZGPERMvWWH96ZvFX4ITsXhWO4BmdVogv6mCHnHKfWW1/A2fQ0iVd1CZ7kboEXHAm2Kww7vc0o/5+y4VFEDU0mVLpnpjlaFA5f9+LtmlEr+xP8IGNr2NscrIscv21jDAvWlYY4SPG6btCWzr08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711559160; c=relaxed/simple; bh=pmE/WNsN48zINl0lqmAAtZNwjI8ndKJP9+bm1YuX6p4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YvhwxOz77t0IuYMhu9uGndN6prAh+/En4A7tkCJZCrHw9RmGJADEfl4z7Elwros5Dw3Dyx635mPdJ8vPFQGBZ79/gdWQCHfOc+EquEXHE81AVBAJaBBsYIiTqgzhdYyOGjSoWCLR8DWF9P6T5LKaujDpWzMrs1hHO/U8EHC2wug= 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=TpCYXb0d; 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=1711559157; 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=9PPCx7i0tEizVRzpeoi4x1mQBKJiyNyYCbcOnRkQ3J4=; b=TpCYXb0dlRJea51ilRHQWojv/GEMO4fY/KX1zdR4ciOBzw1CmSzFO+yQP7r8kI4p3YfVnw VggsXOCGEmdvvRR7lxFexyZF56BkGlIZZAaC8W2vG/gcUam9GjTaACxAq25NOydl6Jy6hA hakolJdj67BBkfOtRwq8Y2MIZzml3XA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-mosBsRfXPPKZwrVOz6jeVw-1; Wed, 27 Mar 2024 13:05:55 -0400 X-MC-Unique: mosBsRfXPPKZwrVOz6jeVw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-41489c04e3aso135945e9.0 for ; Wed, 27 Mar 2024 10:05:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711559154; x=1712163954; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9PPCx7i0tEizVRzpeoi4x1mQBKJiyNyYCbcOnRkQ3J4=; b=STien+3s+Idh/1BiXf5zIf9t+h+c4ADQN/yF4uIHD2ieT1T1Si97Nje2q7LpKid9F/ 3o0hPTJSC9jCiJGX8HYxMbLrMwzN5IoQFLq97dTpetD+1PhXI813gqNpMBA6hmd6ypt9 TUv3G5t7CawvBaapn4fQ0sUYUB3aDz93Vtk8tAYz+7tJJrAuopVnSyTYSzfM51wcedOh IO8W5Z/Ir0LKaWcjdvh6dGG+itp+Fsbd2HEHpRA1iNM5ozTLI/TP+s2/vOmLgLhcGBD0 xWM1kyPJ8IQyMs8JzSKLuiKtaWr2dXVTYzEXV+yRe5vvvERwyZC7deMv9HWjt0wJMSAy GG7Q== X-Forwarded-Encrypted: i=1; AJvYcCVrL0G1UhrDi13KF0rw3fBEVd7+XbOrlDF7To4WSmmvPSFG/nxFBZnS6veH3RQ6BYJodHzs7lg47UlKugWO0B67jOXXxd5bAKNwo6S7 X-Gm-Message-State: AOJu0YypFteRN+0veV+15QBPt880R4FWwzSa+ZxO7yGXGh3aAR7tssoS 8qA+BkBt4XqE+xPicwBS0CNBPjfgWvUt4UTFlu78AxpeFA/MaWnLMhCfdYjlM7n25IfU7M0Iy+p kQXj17W1wjEyUWIdVkUF58qlHXIwDx8L+xeMcjL30OVy7jVbwImTmz8WNrOrdow== X-Received: by 2002:a05:600c:4189:b0:414:ae9b:7d71 with SMTP id p9-20020a05600c418900b00414ae9b7d71mr390756wmh.27.1711559154608; Wed, 27 Mar 2024 10:05:54 -0700 (PDT) X-Received: by 2002:a05:600c:4189:b0:414:ae9b:7d71 with SMTP id p9-20020a05600c418900b00414ae9b7d71mr390729wmh.27.1711559154193; Wed, 27 Mar 2024 10:05:54 -0700 (PDT) Received: from ?IPV6:2003:cb:c708:8a00:362b:7e34:a3bc:9ddf? (p200300cbc7088a00362b7e34a3bc9ddf.dip0.t-ipconnect.de. [2003:cb:c708:8a00:362b:7e34:a3bc:9ddf]) by smtp.gmail.com with ESMTPSA id l20-20020a05600c1d1400b004146a304863sm2703001wms.34.2024.03.27.10.05.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 10:05:53 -0700 (PDT) Message-ID: <44fc26ae-de7d-4bed-af7b-bcd2c593c676@redhat.com> Date: Wed, 27 Mar 2024 18:05:52 +0100 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: [RFC PATCH v1 3/4] mm/memory: Use ptep_get_lockless_norecency() for orig_pte Content-Language: en-US To: Ryan Roberts , Mark Rutland , Catalin Marinas , Will Deacon , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Andrew Morton , Muchun Song Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240215121756.2734131-1-ryan.roberts@arm.com> <20240215121756.2734131-4-ryan.roberts@arm.com> <6aaff470-c510-469b-8f4f-2e4c5cf07d56@redhat.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyK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3xajVH32Ms6t1trDQmPx2iP5+7iDsb7OKAb5eOS8h+BEBDeq 3ecsQDv0fFJOA9ag5O3LLNk+3x3q7e0uo06XMaY7UHS341ozXUUI7wC7iKfoUTv03iO9El5f XpNMx/YrIMduZ2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 27.03.24 10:51, Ryan Roberts wrote: > On 26/03/2024 17:58, David Hildenbrand wrote: >>>>>> >>>>>> vmf->orig_pte = ptep_get_lockless_norecency(vmf->pte) >>>>>> /* not dirty */ >>>>>> >>>>>> /* Now, thread 2 ends up setting the PTE dirty under PT lock. */ >>> >>> Ahh, this comment about thread 2 is not referring to the code immediately below >>> it. It all makes much more sense now. :) >> >> Sorry :) >> >>> >>>>>> >>>>>> spin_lock(vmf->ptl); >>>>>> entry = vmf->orig_pte; >>>>>> if (unlikely(!pte_same(ptep_get(vmf->pte), entry))) { >>>>>>       ... >>>>>> } >>>>>> ... >>>>>> entry = pte_mkyoung(entry); >>>>> >>>>> Do you mean pte_mkdirty() here? You're talking about dirty everywhere else. >>>> >>>> No, that is just thread 1 seeing "oh, nothing to do" and then goes ahead and >>>> unconditionally does that in handle_pte_fault(). >>>> >>>>> >>>>>> if (ptep_set_access_flags(vmf->vma, ...) >>>>>> ... >>>>>> pte_unmap_unlock(vmf->pte, vmf->ptl); >>>>>> >>>>>> >>>>>> Generic ptep_set_access_flags() will do another pte_same() check and realize >>>>>> "hey, there was a change!" let's update the PTE! >>>>>> >>>>>> set_pte_at(vma->vm_mm, address, ptep, entry); >>>>> >>>>> This is called from the generic ptep_set_access_flags() in your example, right? >>>>> >>>> >>>> Yes. >>>> >>>>>> >>>>>> would overwrite the dirty bit set by thread 2. >>>>> >>>>> I'm not really sure what you are getting at... Is your concern that there is a >>>>> race where the page could become dirty in the meantime and it now gets lost? I >>>>> think that's why arm64 overrides ptep_set_access_flags(); since the hw can >>>>> update access/dirty we have to deal with the races. >>>> >>>> My concern is that your patch can in subtle ways lead to use losing PTE dirty >>>> bits on architectures that don't have the HW-managed dirty bit. They do exist ;) >>> >>> But I think the example you give can already happen today? Thread 1 reads >>> orig_pte = ptep_get_lockless(). So that's already racy, if thread 2 is going to >>> set dirty just after the get, then thread 1 is going to set the PTE back to (a >>> modified version of) orig_pte. Isn't it already broken? >> >> No, because the pte_same() check under PTL would have detected it, and we would >> have backed out. And I think the problem comes to live when we convert >> pte_same()->pte_same_norecency(), because we fail to protect PTE access/dirty >> changes that happend under PTL from another thread. > > Ahh yep. Got it. I absolutely knew that you would be correct, but I still walked > right into it! > > I think one could argue that the generic ptep_set_access_flags() is not > implementing its own spec: > > " > ... Only sets the access flags (dirty, accessed), as well as write permission. > Furthermore, we know it always gets set to a "more permissive" setting ... > " > > Surely it should be folding the access and dirty bits from *ptep into entry if > they are set? Likely yes. Unless it's also used to clear access/dirty (don't think so, and would not be documented). But the simplification made sense for now, because you previously checked that pte_same(), and nobody can modify it concurrently. > > Regardless, I think this example proves that its fragile and subtle. I'm not > really sure how to fix it more generally/robustly. Any thoughts? If not perhaps > we are better off keeping ptep_get_lockless() around and only using > ptep_get_lockless_norecency() for the really obviously correct cases? Maybe one of the "sources of problems" is that we have a ptep_get_lockless_norecency() call followed by a pte_same() check, like done here. Not the source of all problems I believe, though ... -- Cheers, David / dhildenb