Message ID | 20240306104147.193052-3-peterx@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 56271C5475B for <linux-mm@archiver.kernel.org>; Wed, 6 Mar 2024 10:42:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D1E076B009C; Wed, 6 Mar 2024 05:42:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CA70E6B009D; Wed, 6 Mar 2024 05:42:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B48A36B009E; Wed, 6 Mar 2024 05:42:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 978696B009C for <linux-mm@kvack.org>; Wed, 6 Mar 2024 05:42:19 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 598CB1A0DF1 for <linux-mm@kvack.org>; Wed, 6 Mar 2024 10:42:19 +0000 (UTC) X-FDA: 81866274798.20.4C3B7DD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id BF465A001D for <linux-mm@kvack.org>; Wed, 6 Mar 2024 10:42:17 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GFsbtedn; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709721737; 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=3D9LYre9es5Pr/ZmF0ksBqg/v+REJVkPqwZxeVyu2sc=; b=0ME6JoL+XpyF/d7Lehd4vP1OyM8Jh6cVFOBIeE6YjwuegXH0lOaXYL6icANMcZ1hD75NY8 XoyTX0WJqIzwb+iVK0S5ErYXMTzSDzO7XEhPXYUNUsiLActFI1TRRTnFuE0b7Yk600tFdu C2iAleWQde5yB1BT2eAVFgSVFqnBpcU= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GFsbtedn; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf15.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709721737; a=rsa-sha256; cv=none; b=Xt4HzzgTCLIcAdLyfnB22hjgbv5cc2ZO2UCUkQjeH+nyElV9XAOEuPCo7UzlEBIzVPSFpG OGBxK2dYEfcBcEbNoWYe29GPUoCKSij//JQVVFlfiUoLGTj1ekwJUWdYYnT0L2E1TXu/n7 xGIRqIsrVl1/Paic2eaBE6Y/QcfERWk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709721737; 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=3D9LYre9es5Pr/ZmF0ksBqg/v+REJVkPqwZxeVyu2sc=; b=GFsbtednPaA4KzBXKK4uD2Jr3QnquLYWokFhihg3yKEZtwQz5lSCOeMM1En2bXVZdG+B3O bb3sSycZFo37y/kkG824fNpqyHd1nXYKC+TxucQVFov0onk9xFv4J9OI6wv1IL8KTgK3zu FeQB+z2QRO/C1H2pcyjNHtQnuBvN+hE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-uC-oagQgMFWs_CgooWNVxQ-1; Wed, 06 Mar 2024 05:42:11 -0500 X-MC-Unique: uC-oagQgMFWs_CgooWNVxQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D81EA8007A2; Wed, 6 Mar 2024 10:42:10 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97C19112131D; Wed, 6 Mar 2024 10:42:04 +0000 (UTC) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Andrew Morton <akpm@linux-foundation.org>, Muchun Song <muchun.song@linux.dev>, Jason Gunthorpe <jgg@nvidia.com>, peterx@redhat.com, Matthew Wilcox <willy@infradead.org>, Mike Rapoport <rppt@kernel.org>, Christophe Leroy <christophe.leroy@csgroup.eu>, x86@kernel.org, sparclinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 02/13] mm/gup: Cache p4d in follow_p4d_mask() Date: Wed, 6 Mar 2024 18:41:36 +0800 Message-ID: <20240306104147.193052-3-peterx@redhat.com> In-Reply-To: <20240306104147.193052-1-peterx@redhat.com> References: <20240306104147.193052-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspamd-Server: r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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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/treewide: Remove pXd_huge() API
|
expand
|
diff --git a/mm/gup.c b/mm/gup.c index df83182ec72d..69a777f4fc5c 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -772,16 +772,17 @@ static struct page *follow_p4d_mask(struct vm_area_struct *vma, unsigned int flags, struct follow_page_context *ctx) { - p4d_t *p4d; + p4d_t *p4dp, p4d; - p4d = p4d_offset(pgdp, address); - if (p4d_none(*p4d)) + p4dp = p4d_offset(pgdp, address); + p4d = READ_ONCE(*p4dp); + if (p4d_none(p4d)) return no_page_table(vma, flags); - BUILD_BUG_ON(p4d_huge(*p4d)); - if (unlikely(p4d_bad(*p4d))) + BUILD_BUG_ON(p4d_huge(p4d)); + if (unlikely(p4d_bad(p4d))) return no_page_table(vma, flags); - return follow_pud_mask(vma, address, p4d, flags, ctx); + return follow_pud_mask(vma, address, p4dp, flags, ctx); } /**