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 X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56D9AC433ED for ; Thu, 20 May 2021 02:18:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C2015611BD for ; Thu, 20 May 2021 02:18:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2015611BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4E68B6B006C; Wed, 19 May 2021 22:18:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 496216B006E; Wed, 19 May 2021 22:18:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35E536B0070; Wed, 19 May 2021 22:18:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id 000C26B006C for ; Wed, 19 May 2021 22:18:48 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 95A5B824C44E for ; Thu, 20 May 2021 02:18:48 +0000 (UTC) X-FDA: 78160001136.35.39BDA00 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 36627E0001B2 for ; Thu, 20 May 2021 02:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621477127; 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=sHDqMefuS0jfZY78aneKv+C4tqai2cafaPaE1zr9kR4=; b=aMy+3gB9J5QTPEyxjN2/r/RI7Sz4WA2SyLr4r8s5GgXd9qgfAhRXLQ7tnqWUrRCw7yiPf1 xo5ZLw9n5A/XmpJg7Ymvj4Eqsb8Q2fUjV2S8QeZofY/mhOxDYNvQ144h2ChhZHl21a9KiK 1Mdw8Favoe9NVRF951PzLNkMi9kRwcM= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-ipvF5ptyMKmhqBq4msiWew-1; Wed, 19 May 2021 22:18:45 -0400 X-MC-Unique: ipvF5ptyMKmhqBq4msiWew-1 Received: by mail-qt1-f200.google.com with SMTP id o15-20020a05622a138fb02901e0ac29f6b2so11213715qtk.11 for ; Wed, 19 May 2021 19:18:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sHDqMefuS0jfZY78aneKv+C4tqai2cafaPaE1zr9kR4=; b=AsiGJ00P1Ojo4JnSbabI+PLtpJdGXvysDGC8UUXx+QKyOcYdkaprSYKBoXMJpYym+3 pOjsmHi0ksUOyhl7XWoFAehqtjmx/VfRMzqKOVpubBd/GspFWyQ2Qrv+V6A3lQw5UxhM qRX//Hi8frDz5fPNaJ+JyitNW8YxqJXU8XczXFEe/eia/7Vm0lYFcta/bMDHLQGgkxUE p1/pSZ/U+wdfC8g0fBRPalIhw+6UMJHnFQL6Llx4mjnZkIHTRixFosFacj8L01gYE05p qutsDnvt+XdgkNnd5udKXQGPpDZk+rymo6AIUSEagStJ+av5uxCJseMtf1vQHUpNXog/ KajA== X-Gm-Message-State: AOAM5305FYDt0uBAZFUKKrdieWiAyj6gLL6vnVa/bw85HKbTLd6AGlw6 R4JCemG0JdCB+1XJeRNUvduce8Oq1hjBaGEJMMncRJgj+b8TVCeH7nSfNwg2rzgOiBTcrpOT+AC zS13gI3YRM8w= X-Received: by 2002:a0c:e601:: with SMTP id z1mr2909832qvm.62.1621477125370; Wed, 19 May 2021 19:18:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPjm1JJXTWz/eOauSQvLjSeZzx1RIOLWGjlNLXK3o/XwUebWLz4kqwZAF4my19038LoZ+q1g== X-Received: by 2002:a0c:e601:: with SMTP id z1mr2909808qvm.62.1621477125084; Wed, 19 May 2021 19:18:45 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id m21sm980797qtu.11.2021.05.19.19.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 19:18:44 -0700 (PDT) Date: Wed, 19 May 2021 22:18:43 -0400 From: Peter Xu To: "Aneesh Kumar K.V" Cc: Nathan Chancellor , linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, kaleshsingh@google.com, npiggin@gmail.com, joel@joelfernandes.org, Christophe Leroy Subject: Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries Message-ID: References: <20210422054323.150993-1-aneesh.kumar@linux.ibm.com> <20210422054323.150993-4-aneesh.kumar@linux.ibm.com> <87mtsrqqk0.fsf@linux.ibm.com> MIME-Version: 1.0 In-Reply-To: <87mtsrqqk0.fsf@linux.ibm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 36627E0001B2 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aMy+3gB9; spf=none (imf30.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Stat-Signature: ona3ztwqc4ij3mtdbcbnwt6ko5g3wex3 X-HE-Tag: 1621477127-585855 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: On Wed, May 19, 2021 at 10:16:07AM +0530, Aneesh Kumar K.V wrote: > > On Thu, Apr 22, 2021 at 11:13:17AM +0530, Aneesh Kumar K.V wrote: > >> pmd/pud_populate is the right interface to be used to set the respective > >> page table entries. Some architectures like ppc64 do assume that set_pmd/pud_at > >> can only be used to set a hugepage PTE. Since we are not setting up a hugepage > >> PTE here, use the pmd/pud_populate interface. [1] > Can you try this change? > > modified mm/mremap.c > @@ -279,7 +279,7 @@ static bool move_normal_pmd(struct vm_area_struct *vma, unsigned long old_addr, > pmd_clear(old_pmd); > > VM_BUG_ON(!pmd_none(*new_pmd)); > - pmd_populate(mm, new_pmd, (pgtable_t)pmd_page_vaddr(pmd)); > + pmd_populate(mm, new_pmd, pmd_pgtable(pmd)); > > if (new_ptl != old_ptl) > spin_unlock(new_ptl); I reported this issue today somewhere else: https://lore.kernel.org/linux-mm/YKVemB5DuSqLFmmz@t490s/ And came to this same line after the bisection. This seems to work at least for my userfaultfd test on shmem, however I don't fully understand the commit message [1] on: How do we guarantee we're not moving a thp pte? -- Peter Xu