From mboxrd@z Thu Jan 1 00:00:00 1970 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 10AA3C35FFA for ; Wed, 19 Mar 2025 14:10:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63FAC280002; Wed, 19 Mar 2025 10:10:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EECD280001; Wed, 19 Mar 2025 10:10:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DDE2280002; Wed, 19 Mar 2025 10:10:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 30749280001 for ; Wed, 19 Mar 2025 10:10:38 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8F467A7CC3 for ; Wed, 19 Mar 2025 14:10:39 +0000 (UTC) X-FDA: 83238486198.12.769CE40 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 5C87C14001A for ; Wed, 19 Mar 2025 14:10:35 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JLR+OkWX; spf=pass (imf09.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1742393435; 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:in-reply-to:references:references:dkim-signature; bh=5YfaaTsjeKp9QHHjLoM74t1Q+e1rTjBGJL9IkIlUuyA=; b=nhpUt+Jz6B6OIANtwBuL6d03+7VwE1bu9hmMAFShkVsu++ruj5raBesHE+1GINY6J8pZLf Dj2jVhq8ugiYkcdiuO+Ea7FyyCYCS9AXVznonJkpxxG/Jc5nYgKjoTOGLq9xO89xj6gWfP ATwqEk3V87zUJBYdrWFrUYPo4MMOJ8I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1742393435; a=rsa-sha256; cv=none; b=2UHW+WpxCDKcxu6eHLDITGT5V13zk39KsCJovVZCrIuAWDvz4Yz6Om93IflahsT+55ym+k hqfGAFYfcsoAvCGgx7EDOSrINxRWOm9VZjrOjV3UbMon7n8I3YO00Vv4Ahay0WthrcKkX/ KZPjJWl3eASBG+ne9a9cR2Hfbg9mzS8= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JLR+OkWX; spf=pass (imf09.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742393434; 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; bh=5YfaaTsjeKp9QHHjLoM74t1Q+e1rTjBGJL9IkIlUuyA=; b=JLR+OkWXQR3/UWPaAB+jUuneq56KvEbaMHw/fCljcc3jVhrA9X07ORH6MG7EgnVaAtzP1l k2xRmx1r2w27koETFPRIdRbXS/6WnBtgqDWpYEGHeYyebc5ioQ+UAmjkmJIy3e+2RkOFcF eauepjtYIXMa4fTNeKPG1ZauwrFoX3A= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-hvx2xIvKNculXV_iCPuZJQ-1; Wed, 19 Mar 2025 10:10:33 -0400 X-MC-Unique: hvx2xIvKNculXV_iCPuZJQ-1 X-Mimecast-MFC-AGG-ID: hvx2xIvKNculXV_iCPuZJQ_1742393433 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7c0c1025a6cso1365293285a.0 for ; Wed, 19 Mar 2025 07:10:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742393432; x=1742998232; h=in-reply-to:content-transfer-encoding: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=5YfaaTsjeKp9QHHjLoM74t1Q+e1rTjBGJL9IkIlUuyA=; b=JM2QcFpPD47bQFbUDW1cmWvxuBj76dpDgCnc6S46hjSAS4afx+PzmOoeT1SpXzILbt P6uneCUDud+xVcFxOLKQIjwOGw0LOmpOK+PXy0sJc3HoHAG1fczaTrbcROCIeMpKRiMg 4dGDg5Bg1dgxw9yAOZV5cwJMJa4Rbvqi1Mu3tcI1/WMTY1bJW2VsLhnqjAyIBF/6Lgfk shsqFWgSMRCx6/Ky8KimYYPaArSlh96/sCuitT7R2EYZZ9Q/zErx0qaoBoLksaHRy0s0 yXrL9svG4elcWX59kWDLDbVQEmU2qdQaoK376iU+dDqGQQCWrnSZ0iUEAYwR+S8floVP iZVA== X-Gm-Message-State: AOJu0YwS8eggUEOOPDy8Eglu/m031ZtlXHsPElN284Jog8xEzv7U49pT PJmUhE/hXv45k6tPXpKkRWeE+gJMFtVIN8n5e7yhVpQ0IkGSCo+PX1v3xIN0f+40q+fpl6lztqU feSS/l8IPvRM5jR/omk5dPDZwxx/dcKZUAApAubZeefzOFZSD X-Gm-Gg: ASbGncvesv2Ne6BJJdkUK6QZS4auKgQn7AXzn6Gc9yYacqL/9i+yq8TOAY8FezDYzWz sgxwGVD/CPfiNufI8xS/+nw0IqfUu9FxFgUuI//qbAyqMj8PqSs1yleH5XNa6wXWL1SDQ6nCWnF 9RTPMAom85gVfIKUXk1t2qRaqmI9WLLb1YBUEl/MaWmkrT6lKhB0h3/Z7634ROTPcpaKlOAm78B gTRKLpywMUefBiqfzeyVvgct1Moqpah+IogyBj/RZOiLYNURrX6y28CSpSxA6HbsJ4niOFBmUpo G9NWhzI= X-Received: by 2002:a05:620a:4115:b0:7c5:53ab:a722 with SMTP id af79cd13be357-7c5a828877amr363484485a.5.1742393432575; Wed, 19 Mar 2025 07:10:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbv4DWuFiCjEaFXWxjsrrFoQIua6dHvV3yMHaR1gXg9WWkb+lQDG9W8w2LdUSWNz1T7niCsQ== X-Received: by 2002:a05:620a:4115:b0:7c5:53ab:a722 with SMTP id af79cd13be357-7c5a828877amr363481985a.5.1742393432300; Wed, 19 Mar 2025 07:10:32 -0700 (PDT) Received: from x1.local ([85.131.185.92]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c573d89815sm865870985a.91.2025.03.19.07.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 07:10:30 -0700 (PDT) Date: Wed, 19 Mar 2025 10:10:27 -0400 From: Peter Xu To: Marty Kareem Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, shuah@kernel.org Subject: Re: [PATCH v2] [PATCH RESEND] mm/selftest: Replace static BASE_PMD_ADDR with dynamic address allocation Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tmDUc2OAEYdhpJdrFTr65qP5QlKJn8qeQSjYVmBLJnM_1742393433 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 5C87C14001A X-Stat-Signature: nkfp8uyupexxajimtzgcyae7tjt7z76x X-HE-Tag: 1742393435-392878 X-HE-Meta: U2FsdGVkX18d1ovadreIZ1fF8R/BVDDJqg0nrxMaugiQKDD+qzeJQ2MVrZbaqhF7rLIkt3cQMxpHtpW1PjSZyFiJrAklR7Pm4+1tCcS8Yu52KeP/dOb16DZVtlUIyeWa+QgbmOkWe22MEu1MwtYJGFbv2xaWHrL7qZ2VF7MBOd5NbEl4yzm+fAyAuqriYxzkmvy8YS9ia0JoWLvgDh/YXim1KhtQ6uwfYWbN3AGCGDzKQ2uR2Q0q4ZN7rB0ZSZN+CSrtRVPjq8dI9IYHI47HoAkfeR8vR+4ADJt9kOXgmvKbNjChSiYthnjsiY4TLlha8TQ7zGpGSOjb4uVN6p7mSzK/AQxATicw5oViZRcApQdGb0ikoeacY4IV8OH2YjpX+B88g4p/FowhF4QXsiMgVFy+lDBHnmvk7arGeToR/a/oJl5zzod7o2ocUasRKHWKdGLur+TriHJxXRYspNdcPsE4n2YmurGJdTlWKcVCxiebDZgUcxyDipV8l0tp27MXwtCK9fH8vzyIMY4fKDgGTlmTn8dLqm51lhgrF4NSGKAVoHT9TyxdVq+OzDmHRPDwHqQFtz1zji4Wrtrt8NVeIFyYR08FHUcPcULNb6uT8YWVz8Gen/Ngm6hogTC8RUcD5EbzTMhEhyrIyocK0LUOQdX80L41pqbfHFyTcJD3IA6YP9E9YQ71d6Q4xtLDsaKVYYOzvKhqFC7PD594DeXDXJ/K22d1EIplvpYL7BawKaiCVY1bMYVxisxTZpeUa7VxAfD2NMd9Rw4TyCVdrGl7VUqIxILjS+gelab5/3xoycRD8sCiITcbwLoj2V5Mz0/r4DTdPP/APrBnfTNhtNJGUKTwbE4l8GzkDz7NiCRApMZ1Rwe5Zq6G4MsPU1945/ouhIe9YR/sr2ZsiOENJwkKb9NE+FnKrWVfQ4CoFpiWD2DwS68r+KzpPSUSgQrU4k77tf9gZg1MYtMCQMRdwu9 PCU5pmBc MOmQrBCvi7mZeJK8IQXdoWhwJHpE+zFfx9COoDmrzFsg4La/ZBFX69oxQZvLK/8D6vTgR94lUhk7Pm6C5mSgAZC1/HC2AJj7/aEtsEit1J6lUfU7OY7QVnc0DPuV2GjK8UJppAuOq+ZV1hyhIWbk8UGJoJgoNertIJuFkNwiPLbToggy+f+dS3M+6M21DVyxLXknJRGBxpedCRWTPVFA+4EfL1Sb3LHCPdenRzqYI3xXGsQI3DM3/htw1PIFW6VRakFtXOSklehqnnLSbCe8qPUt8vQFMMZeX3N5wNZ4Mz0yZa/UUIKAOtdTuSDqvZ+WpOjdW/SaI+M6eKF4EjaARMjRCljHnNjABkT0vK7C8gLo+KQnWSn2ON5JOKLWf1q58j0ywrx5MRQQq6Y51uQ+cVzc6/NLkihT0MZgz X-Bogosity: Ham, tests=bogofilter, spamicity=0.000042, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Mar 18, 2025 at 10:35:33PM -0400, Marty Kareem wrote: > Hi Peter, Marty, > > Thank you for your detailed review and suggestions. > > I've updated the patch to address the race condition you highlighted. In this v2 patch, the following changes have been made: > > 1. The PROT_NONE reservation is maintained until it can be atomically replaced. > > 2. I now use MAP_FIXED to atomically replace the reservation with the intended mapping. > > 3. The MAP_FIXED_NOREPLACE conditionals have been removed, as the atomic replacement works reliably across all kernel versions. > > 4. The overall implementation has been simplified while ensuring robustness. All look good here, thanks. > > These modifications ensure that the memory region remains reserved until it is atomically replaced, effectively eliminating the race window and improving test reliability—especially in parallel test environments. Benchmark results show only a minimal performance impact (approximately 1.3x overhead vs. static addressing), and all tests pass successfully. > > One note: I'm currently having some issues with git send-email and my Outlook account, so I'm sending this patch through Thunderbird as a plain text attachment. I’m working on resolving the git send-email setup for future submissions. If your intention is to try working on something on Linux, let's try to fix this. Using attachment is not the normal workflow, so you'll need it sooner or later. I bet now with all the AI stuff recently, it shouldn't be hard to ask and get something to try even without asking on the list, AI should be able to look at your specific issue. Then please send your v2 formally with git send-email. You can start testing that with sending to yourself of course. Good luck, -- Peter Xu