From patchwork Thu Aug 25 16:46:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 12955085 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 E9975ECAA24 for ; Thu, 25 Aug 2022 16:47:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 860B66B007B; Thu, 25 Aug 2022 12:47:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80EC36B007D; Thu, 25 Aug 2022 12:47:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7022F940007; Thu, 25 Aug 2022 12:47:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 628786B007B for ; Thu, 25 Aug 2022 12:47:19 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3D64A41D2A for ; Thu, 25 Aug 2022 16:47:19 +0000 (UTC) X-FDA: 79838695398.28.BCE980D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf11.hostedemail.com (Postfix) with ESMTP id F129940007 for ; Thu, 25 Aug 2022 16:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661446037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtxYVN1b73jxS32uO5RlU+EmZHH9eyqhBC2B1AT9Izo=; b=S9Js5PKGrGc9AOt8fsP794RG7HizgMlZ0flvlrPaPd2xdKFzqeE/Na2BK6sZCXaQDwZXNA SLXKHf7q8jyM9PKz+d6am+9DBN2UPUzgpGtBZHfO7KtPjSV8IzMWpdbUn+BA/Jzy0CaANE Q4+N1Jh4kV+LON/8tt0LJZy5IBcNaes= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-gOthU2mwMBair-ARSgbNrQ-1; Thu, 25 Aug 2022 12:47:07 -0400 X-MC-Unique: gOthU2mwMBair-ARSgbNrQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F1371C09C9A; Thu, 25 Aug 2022 16:47:06 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.192.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0BE5492CA2; Thu, 25 Aug 2022 16:47:03 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Mel Gorman , Jason Gunthorpe , John Hubbard , "Matthew Wilcox (Oracle)" , Andrea Arcangeli , Hugh Dickins , Peter Xu Subject: [PATCH v1 1/3] mm/gup: replace FOLL_NUMA by gup_can_follow_protnone() Date: Thu, 25 Aug 2022 18:46:57 +0200 Message-Id: <20220825164659.89824-2-david@redhat.com> In-Reply-To: <20220825164659.89824-1-david@redhat.com> References: <20220825164659.89824-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661446039; a=rsa-sha256; cv=none; b=nSRuEFRYdCdIxbf803DZxbumjjqJaWhxBdaf+HvAyVkeZdoFUie69/B54Ij9dFajedjHeg VUk0Ksqr3ergLBe3L8NFqTG1/CyL1/KNwIDpNsgRZyYvaHugvecOCaj7T8lxdGXqraS7so t73XeM1bGWUyxU2NtM14tCvr+Q8dNII= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S9Js5PKG; spf=pass (imf11.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661446039; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qtxYVN1b73jxS32uO5RlU+EmZHH9eyqhBC2B1AT9Izo=; b=2W1IT1VZKlZE9h0RVNuV1H++P/4cqY7YI0mWgoqwSLixPkUb999qgefcrn1XIJ6dfSrShB W/xh4+/nLIwwUQDwMemC55ti3J3Zo1/+VJBvmc0MgiJwpUkavuKSUEolNuQ9fpwnCpCr7L WSHc+sjwI2l8JgS0P3dV/OwBqiMqIBs= X-Stat-Signature: 6kbytyrqyeoq9bnh9t3szwkyr7k54bs7 X-Rspamd-Queue-Id: F129940007 X-Rspam-User: X-Rspamd-Server: rspam06 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S9Js5PKG; spf=pass (imf11.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1661446038-17632 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: No need for a special flag that is not even properly documented to be internal-only. Let's just factor this check out and get rid of this flag. The separate function has the nice benefit that we can centralize comments. Signed-off-by: David Hildenbrand --- include/linux/mm.h | 16 +++++++++++++++- mm/gup.c | 12 ++---------- mm/huge_memory.c | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 982f2607180b..8b85765d7a98 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2881,7 +2881,6 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, * and return without waiting upon it */ #define FOLL_NOFAULT 0x80 /* do not fault in pages */ #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ -#define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */ #define FOLL_REMOTE 0x2000 /* we are working on non-current tsk/mm */ @@ -2997,6 +2996,21 @@ static inline bool gup_must_unshare(unsigned int flags, struct page *page) return !PageAnonExclusive(page); } +/* + * Indicates whether GUP can follow a PROT_NONE mapped page, or whether + * a (NUMA hinting) fault is required. + */ +static inline bool gup_can_follow_protnone(unsigned int flags) +{ + /* + * FOLL_FORCE has to be able to make progress even if the VMA is + * inaccessible. Further, FOLL_FORCE access usually does not represent + * application behaviour and we should avoid triggering NUMA hinting + * faults. + */ + return flags & FOLL_FORCE; +} + typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data); extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); diff --git a/mm/gup.c b/mm/gup.c index 5abdaf487460..a1355dbd848e 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -554,7 +554,7 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, migration_entry_wait(mm, pmd, address); goto retry; } - if ((flags & FOLL_NUMA) && pte_protnone(pte)) + if (pte_protnone(pte) && !gup_can_follow_protnone(flags)) goto no_page; page = vm_normal_page(vma, address, pte); @@ -707,7 +707,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma, if (likely(!pmd_trans_huge(pmdval))) return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); - if ((flags & FOLL_NUMA) && pmd_protnone(pmdval)) + if (pmd_protnone(pmdval) && !gup_can_follow_protnone(flags)) return no_page_table(vma, flags); retry_locked: @@ -1153,14 +1153,6 @@ static long __get_user_pages(struct mm_struct *mm, VM_BUG_ON(!!pages != !!(gup_flags & (FOLL_GET | FOLL_PIN))); - /* - * If FOLL_FORCE is set then do not force a full fault as the hinting - * fault information is unrelated to the reference behaviour of a task - * using the address space - */ - if (!(gup_flags & FOLL_FORCE)) - gup_flags |= FOLL_NUMA; - do { struct page *page; unsigned int foll_flags = gup_flags; diff --git a/mm/huge_memory.c b/mm/huge_memory.c index e9414ee57c5b..482c1826e723 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1449,7 +1449,7 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, return ERR_PTR(-EFAULT); /* Full NUMA hinting faults to serialise migration in fault paths */ - if ((flags & FOLL_NUMA) && pmd_protnone(*pmd)) + if (pmd_protnone(*pmd) && !gup_can_follow_protnone(flags)) return NULL; if (!pmd_write(*pmd) && gup_must_unshare(flags, page)) From patchwork Thu Aug 25 16:46:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 12955083 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 F2FADECAA24 for ; Thu, 25 Aug 2022 16:47:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 773756B0075; Thu, 25 Aug 2022 12:47:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 723316B0078; Thu, 25 Aug 2022 12:47:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 612636B007B; Thu, 25 Aug 2022 12:47:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 552976B0075 for ; Thu, 25 Aug 2022 12:47:16 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 213EE81D71 for ; Thu, 25 Aug 2022 16:47:16 +0000 (UTC) X-FDA: 79838695272.01.EDA6C13 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id BD97340005 for ; Thu, 25 Aug 2022 16:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661446035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3NPvWyh2xRtoYXHMmyrsAAtGbzTeyv985JIMuXJIb4=; b=Ik3dAbyBP3eRILyW5gQW835KPNr9Plws4D+AQFrWR4ok0081uAZPeDyfjgU0cp8S5q0y6u fwKpAVmlZhBpA+SR0fwdclz0nILPH19dMSeUK9bUv4NBetUvTvGCA6PjFzNdNC1+9y+r/Q T+vwMa3dRL/p+kN+DWOVI3l93o9isEE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-xXkhVmbBN16ANoNW0OvGkQ-1; Thu, 25 Aug 2022 12:47:09 -0400 X-MC-Unique: xXkhVmbBN16ANoNW0OvGkQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 689E6101AA45; Thu, 25 Aug 2022 16:47:09 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.192.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF705492CA2; Thu, 25 Aug 2022 16:47:06 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Mel Gorman , Jason Gunthorpe , John Hubbard , "Matthew Wilcox (Oracle)" , Andrea Arcangeli , Hugh Dickins , Peter Xu Subject: [PATCH v1 2/3] mm/gup: use gup_can_follow_protnone() also in GUP-fast Date: Thu, 25 Aug 2022 18:46:58 +0200 Message-Id: <20220825164659.89824-3-david@redhat.com> In-Reply-To: <20220825164659.89824-1-david@redhat.com> References: <20220825164659.89824-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ik3dAbyB; spf=pass (imf01.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661446035; a=rsa-sha256; cv=none; b=qqcnR+2jTUoP9lajQ6F1DiKXNqfFo9PzZZwG3Iu/Vn0x+u3f9JdUlFzk1HtdTcpWYAoD8j s782NLanoMerSf85oAVSSz30waJ9xDdyCwWKogDkBt3uBMWQ3t4zYM5+xHx+lhMNSxY89i zwlVPAg+TAFaRjz4jb8L4pPd5Dqk4+Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661446035; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q3NPvWyh2xRtoYXHMmyrsAAtGbzTeyv985JIMuXJIb4=; b=oG4PiPF+a6F6louh2y/hd+yeeuHpm/joXPN8OkEr4fg2hSGvJnSZP1rcRU8394wUOBJGa2 VzR1V/P5UlVRHJLMbaPpO4m78b9t+HfaGuTwKlGJvckXl4gTIj7hyFS8SBUvvu+TgsaOL+ t7AGk65KimCrkf801UAJnTG+GXEGKgg= Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ik3dAbyB; spf=pass (imf01.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Stat-Signature: 13izr6x6dtkqhkqpa15ibr6gtjzgxgj7 X-Rspamd-Queue-Id: BD97340005 X-Rspamd-Server: rspam04 X-HE-Tag: 1661446035-592427 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: There seems to be no reason why FOLL_FORCE during GUP-fast would have to fallback to the slow path when stumbling over a PROT_NONE mapped page. We only have to trigger hinting faults in case FOLL_FORCE is not set, and any kind of fault handling naturally happens from the slow path -- where NUMA hinting accounting/handling would be performed. Note that the comment regarding THP migration is outdated: commit 2b4847e73004 ("mm: numa: serialise parallel get_user_page against THP migration") described that this was required for THP due to lack of PMD migration entries. Nowadays, we do have proper PMD migration entries in place -- see set_pmd_migration_entry(), which does a proper pmdp_invalidate() when placing the migration entry. So let's just reuse gup_can_follow_protnone() here to make it consistent and drop the somewhat outdated comments. Signed-off-by: David Hildenbrand Signed-off-by: David Hildenbrand Signed-off-by: David Hildenbrand --- mm/gup.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index a1355dbd848e..dfef23071dc8 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2350,11 +2350,7 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end, struct page *page; struct folio *folio; - /* - * Similar to the PMD case below, NUMA hinting must take slow - * path using the pte_protnone check. - */ - if (pte_protnone(pte)) + if (pte_protnone(pte) && !gup_can_follow_protnone(flags)) goto pte_unmap; if (!pte_access_permitted(pte, flags & FOLL_WRITE)) @@ -2736,12 +2732,8 @@ static int gup_pmd_range(pud_t *pudp, pud_t pud, unsigned long addr, unsigned lo if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) || pmd_devmap(pmd))) { - /* - * NUMA hinting faults need to be handled in the GUP - * slowpath for accounting purposes and so that they - * can be serialised against THP migration. - */ - if (pmd_protnone(pmd)) + if (pmd_protnone(pmd) && + !gup_can_follow_protnone(flags)) return 0; if (!gup_huge_pmd(pmd, pmdp, addr, next, flags, From patchwork Thu Aug 25 16:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 12955084 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 4D72CECAA27 for ; Thu, 25 Aug 2022 16:47:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C306C6B0078; Thu, 25 Aug 2022 12:47:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B43A06B007B; Thu, 25 Aug 2022 12:47:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BC5F940007; Thu, 25 Aug 2022 12:47:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 91B716B0078 for ; Thu, 25 Aug 2022 12:47:17 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6A104ACA51 for ; Thu, 25 Aug 2022 16:47:17 +0000 (UTC) X-FDA: 79838695314.09.DDA926C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 1EF851A0006 for ; Thu, 25 Aug 2022 16:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661446036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0pHEpCNYxkjW/UyrCPUA7dfCnACPQEp1wsHh/kCfEpU=; b=ic9rS8T6QrIyYJ49y8Z+0SLsIsydE8/d8Gus4k7s/YmM3AUN0lZKa+VRoo5+qfMkPtzoX/ idGjw3QCoKWdOOM0OkHxBpSIM1PUZ89W90RrZmZX18KUh7aZhazng+uQc6zOT9usVBq+zu J6bQzQE5Vphi1sCiqmaIVD6dwEbsOmI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-YJeOGrswNsy7KzmUBM-aoA-1; Thu, 25 Aug 2022 12:47:12 -0400 X-MC-Unique: YJeOGrswNsy7KzmUBM-aoA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D0FB101AA45; Thu, 25 Aug 2022 16:47:11 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.192.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8104492CA2; Thu, 25 Aug 2022 16:47:09 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Mel Gorman , Jason Gunthorpe , John Hubbard , "Matthew Wilcox (Oracle)" , Andrea Arcangeli , Hugh Dickins , Peter Xu Subject: [PATCH v1 3/3] mm: fixup documentation regarding pte_numa() and PROT_NUMA Date: Thu, 25 Aug 2022 18:46:59 +0200 Message-Id: <20220825164659.89824-4-david@redhat.com> In-Reply-To: <20220825164659.89824-1-david@redhat.com> References: <20220825164659.89824-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ic9rS8T6; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661446037; a=rsa-sha256; cv=none; b=Xoudx16QarYqTyM3XbBbyjSzLYg5R6hUWRy/nWd6+5Yp/8yw821bcXnz49euzSZyGY+3Ho j6xyWtb1XOUUMiChxxkMs1mCR1R71NGK/IVxREQbk+wKF3Olaj0mSx/RgxkSoE4YsaFhn9 wxKzggocIfl49ZVKMEcIZ0bFcjg1UYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661446037; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0pHEpCNYxkjW/UyrCPUA7dfCnACPQEp1wsHh/kCfEpU=; b=uOZk/IAAg49NKb5FP047S/BRZ1e3V1solcq3xZGPceEvhXbjnJ4xvYB8PiD72e6ee5BfwX mPEQFfD356YzD66UQdyc/aMCaCKb0LVkikRlvdhrlUEMDmDRbeooqHCVnb0Hzr+zHQbW3B u06UJYW1QtBNzs0jvlvnUZxmHCrlJU0= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1EF851A0006 X-Rspam-User: X-Stat-Signature: gn3ip7i6khxzknzmy5udg7hinwuptkbn Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ic9rS8T6; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1661446036-476630 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: pte_numa() no longer exists -- replaced by pte_protnone() -- and PROT_NUMA probably never existed: MM_CP_PROT_NUMA also ends up using PROT_NONE. Let's fixup the doc. Signed-off-by: David Hildenbrand --- include/linux/mm_types.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index cf97f3884fda..85a6e9853b7b 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -631,22 +631,22 @@ struct mm_struct { #endif #ifdef CONFIG_NUMA_BALANCING /* - * numa_next_scan is the next time that the PTEs will be marked - * pte_numa. NUMA hinting faults will gather statistics and - * migrate pages to new nodes if necessary. + * numa_next_scan is the next time that PTEs will be remapped + * PROT_NONE to trigger NUMA hinting faults; such faults gather + * statistics and migrate pages to new nodes if necessary. */ unsigned long numa_next_scan; - /* Restart point for scanning and setting pte_numa */ + /* Restart point for scanning and remapping PTEs. */ unsigned long numa_scan_offset; - /* numa_scan_seq prevents two threads setting pte_numa */ + /* numa_scan_seq prevents two threads remapping PTEs. */ int numa_scan_seq; #endif /* * An operation with batched TLB flushing is going on. Anything * that can move process memory needs to flush the TLB when - * moving a PROT_NONE or PROT_NUMA mapped page. + * moving a PROT_NONE mapped page. */ atomic_t tlb_flush_pending; #ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH