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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) by smtp.lore.kernel.org (Postfix) with ESMTP id 630E6C25B74 for ; Mon, 27 May 2024 11:26:47 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1v9HSqmM; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xlQOYgcr; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1v9HSqmM; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xlQOYgcr; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VntV86BsSz3vXC for ; Mon, 27 May 2024 21:20:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1v9HSqmM; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xlQOYgcr; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=1v9HSqmM; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xlQOYgcr; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=2a07:de40:b251:101:10:150:64:2; helo=smtp-out2.suse.de; envelope-from=osalvador@suse.de; receiver=lists.ozlabs.org) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4VntTJ1VMdz3fy0 for ; Mon, 27 May 2024 21:19:31 +1000 (AEST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6711B1FCF9; Mon, 27 May 2024 11:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=1v9HSqmM3ByGTDpUJcOlBE7lZwtRH36akLa3r92ozdA0Vig4wwX77SMggBICDlvZtiLWgR B8dzgwKBbCvIkiUrm0pdDG75+gyFW9El6tBG2pV3ODs/5dr+uE9sfV3JgNyMpuoEDap//n RAFkcpV7txMFEaS2dFHuPjxdeukGqOU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=xlQOYgcrsgLz/gT/b41UXdxr3G8IJM2z3u2ptnaoTmir+HwvA8vbdcYm2iRO2RtmV6nnwz lsjfsRa3+2HSBIDw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1v9HSqmM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xlQOYgcr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=1v9HSqmM3ByGTDpUJcOlBE7lZwtRH36akLa3r92ozdA0Vig4wwX77SMggBICDlvZtiLWgR B8dzgwKBbCvIkiUrm0pdDG75+gyFW9El6tBG2pV3ODs/5dr+uE9sfV3JgNyMpuoEDap//n RAFkcpV7txMFEaS2dFHuPjxdeukGqOU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=xlQOYgcrsgLz/gT/b41UXdxr3G8IJM2z3u2ptnaoTmir+HwvA8vbdcYm2iRO2RtmV6nnwz lsjfsRa3+2HSBIDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CDAD713A6B; Mon, 27 May 2024 11:19:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4gE/LzlsVGYmDwAAD6G6ig (envelope-from ); Mon, 27 May 2024 11:19:21 +0000 Date: Mon, 27 May 2024 13:19:12 +0200 From: Oscar Salvador To: Christophe Leroy Subject: Re: [RFC PATCH v3 03/16] mm: Provide mm_struct and address to huge_ptep_get() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-6.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[linux-foundation.org,nvidia.com,redhat.com,ellerman.id.au,gmail.com,vger.kernel.org,kvack.org,lists.ozlabs.org]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; MISSING_XM_UA(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 6711B1FCF9 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Nicholas Piggin , linux-mm@kvack.org, Peter Xu , Jason Gunthorpe , Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sun, May 26, 2024 at 11:22:23AM +0200, Christophe Leroy wrote: > On powerpc 8xx huge_ptep_get() will need to know whether the given > ptep is a PTE entry or a PMD entry. This cannot be known with the > PMD entry itself because there is no easy way to know it from the > content of the entry. > > So huge_ptep_get() will need to know either the size of the page > or get the pmd. > > In order to be consistent with huge_ptep_get_and_clear(), give > mm and address to huge_ptep_get(). > > Signed-off-by: Christophe Leroy > --- > v2: Add missing changes in arch implementations > v3: Fixed a comment in ARM and missing changes in S390 > --- > arch/arm/include/asm/hugetlb-3level.h | 4 +-- > arch/arm64/include/asm/hugetlb.h | 2 +- > arch/arm64/mm/hugetlbpage.c | 2 +- > arch/riscv/include/asm/hugetlb.h | 2 +- > arch/riscv/mm/hugetlbpage.c | 2 +- > arch/s390/include/asm/hugetlb.h | 4 +-- > arch/s390/mm/hugetlbpage.c | 4 +-- I was wondering whether we could do something similar for what we did in patch#1, so we do not touch architectures code. > diff --git a/mm/gup.c b/mm/gup.c > index 1611e73b1121..86b5105b82a1 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -2812,7 +2812,7 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, > if (pte_end < end) > end = pte_end; > > - pte = huge_ptep_get(ptep); > + pte = huge_ptep_get(NULL, addr, ptep); I know that after this series all this code is gone, but I was not sure about the behaviour between this patch and the last one. It made me nervous, until I realized that this code is only used on CONFIG_ARCH_HAS_HUGEPD, which should not be the case anymore for 8xx after patch#8, and since 8xx is the only one that will use the mm parameter from huge_ptep_get, we are all good. -- Oscar Salvador SUSE Labs 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 86034C25B74 for ; Mon, 27 May 2024 11:19:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D6C026B0085; Mon, 27 May 2024 07:19:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1B646B0089; Mon, 27 May 2024 07:19:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE2E06B008A; Mon, 27 May 2024 07:19:28 -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 A09896B0085 for ; Mon, 27 May 2024 07:19:28 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1D122120A34 for ; Mon, 27 May 2024 11:19:28 +0000 (UTC) X-FDA: 82163930016.27.F3EDD58 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf06.hostedemail.com (Postfix) with ESMTP id 6E53B180010 for ; Mon, 27 May 2024 11:19:24 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1v9HSqmM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xlQOYgcr; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1v9HSqmM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xlQOYgcr; spf=pass (imf06.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716808764; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=UeAwB67rXALZt/P8zbG7OKc94i1YXOPMCsQQPPbxLg6hEGl1SaR5OEPD2rivARFuwSUkEg KNTvE1Pug0tsQAWVWY5XS+Mz4mBnL3VvvlE9vc48mV1drsXOqJEbcF34xZnGfOs45WCqHY 9vykwXX+CMbYH4zeqvZp+ac5QUVtz/U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716808764; a=rsa-sha256; cv=none; b=jOsDXJ4pPWMVjT+QeE05G+CBjE0PlQhqimdxjACmdvXKsCTklsQJgEoF4u3mClgFfY1v3F 3spCz+Ii9fRfJf7d+yFHOdps4ChCQzEns339AkWwrcrNvMt8GXK1Vv+art/L+toF5uTvb0 4Deug03umulOsht1W67DUGaGyI9/tf0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1v9HSqmM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xlQOYgcr; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1v9HSqmM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xlQOYgcr; spf=pass (imf06.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6711B1FCF9; Mon, 27 May 2024 11:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=1v9HSqmM3ByGTDpUJcOlBE7lZwtRH36akLa3r92ozdA0Vig4wwX77SMggBICDlvZtiLWgR B8dzgwKBbCvIkiUrm0pdDG75+gyFW9El6tBG2pV3ODs/5dr+uE9sfV3JgNyMpuoEDap//n RAFkcpV7txMFEaS2dFHuPjxdeukGqOU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=xlQOYgcrsgLz/gT/b41UXdxr3G8IJM2z3u2ptnaoTmir+HwvA8vbdcYm2iRO2RtmV6nnwz lsjfsRa3+2HSBIDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=1v9HSqmM3ByGTDpUJcOlBE7lZwtRH36akLa3r92ozdA0Vig4wwX77SMggBICDlvZtiLWgR B8dzgwKBbCvIkiUrm0pdDG75+gyFW9El6tBG2pV3ODs/5dr+uE9sfV3JgNyMpuoEDap//n RAFkcpV7txMFEaS2dFHuPjxdeukGqOU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1716808762; h=from:from:reply-to: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=2Bi7Ql1X3s4Dacbspx0O9yRaUH+sqke7d9JnW3emmk4=; b=xlQOYgcrsgLz/gT/b41UXdxr3G8IJM2z3u2ptnaoTmir+HwvA8vbdcYm2iRO2RtmV6nnwz lsjfsRa3+2HSBIDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CDAD713A6B; Mon, 27 May 2024 11:19:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4gE/LzlsVGYmDwAAD6G6ig (envelope-from ); Mon, 27 May 2024 11:19:21 +0000 Date: Mon, 27 May 2024 13:19:12 +0200 From: Oscar Salvador To: Christophe Leroy Cc: Andrew Morton , Jason Gunthorpe , Peter Xu , Michael Ellerman , Nicholas Piggin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC PATCH v3 03/16] mm: Provide mm_struct and address to huge_ptep_get() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Action: no action X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6E53B180010 X-Rspam-User: X-Stat-Signature: mnpmfeju6azjexnpk4kd8fr59numaxc8 X-HE-Tag: 1716808764-409332 X-HE-Meta: U2FsdGVkX1/5ZXk4MQBNfzIGX7xn9I94agCnFPrnYfgLK42AZAhXbqFqqZ/5AVWhIDA51T3MWIYJz4u2C76Xv5WxIc1GWABOT2vUZWBkWLzonY5ArL3KJFdafllzX1hcxp2T5hKGbuGYPm5W6RVe93OB1t4JJtFR1RpKI7lMfGJCz9FeEeZPeJgwm/isJUsVw8V8dqYPXfSDit7MVn7ZQ1akKVC3o64fuKgWtTA0or99M3oOwYka8ZZPhte27JBac9uy5YjJW/yBZOkZR5LB6w8E7rR88rrsbbVO4LApDpxqDjllB3lvgsM4GBzB09XIn8pU+Bp9VnVc4X74SIA8a+HXYDL9abfU/xQVlw4pyGOnkDxZV45XlKF0xybqueZtJOa2IA1edkw3I0J/pV9sHqAhLY6rVga4Q5sBc6IrPPOwzJ/AjlGu+u6HIU3ZR3itkF9sxtkZqTJhEbi1WXEkBTjKLxmZZjVGX9X6deeKTT0u42PBnP1J8527ZXG3XMsuu7klhJopip36aVTrAG8y4B24pHi4B1NznyNYu4t/9tnhF2FDplA26IauDDb4IONs524suMfuMsXSNSKEP0P1EglW3IZCoamAC42pKqG2RPueKS+ZuUsveQ2SRKEW0A9QSf7geJg2fwuTYriOi/9IBtoctTzxk1B0hHgjdK9k2OsImW7HiH9voWgqz0cncgi3cVWdliPzU8dSxl94aWAz6Xk9Mcdojc354Xsm9HFx9Te4fgJvnCOHkKYoZEfCnR1LBGiXNUqETuKmfoEaD5AI1I/lx1Odz6O2JZQexNZOiOQ2rLRlLinDPh5RSjvyg59DESJARg7TJBryOJvekIcpmZ7t3tFdn/tWPnWoj+d5oIB2dYexJrt1TEbyIqRyHvswQ++0fWcQQpxa3bvZLFXfRDy84XeoPDv3K8Qzf3uJ8CYPP82nyLmIPDM/MdTqyIq1VTMmLcaWzeDJyGxEUzw YK5gFdkb RDH14mAKIl2rUd+nRm8frVlUc7pGEhGFvfT0qFXYkPPaf7p+DTM+2NAL6XcX2c0TTmNv4Hu13Gzk8U93yVJJn3/qj/cAD9d1ykun2wXU1MzrDUpx2BRlz/EDPa/SQWVBRjrzP0JBtqSKUqqc6UjGjT5657Lj/ejtszU5WXQuJAFLZeLYLg67A9K+oFZtX0cmKFMRsgxpB3ZL61zLWaUXFkntCXNtRP7W0VXO0xa4++VPnIt2fYcn6aEyoDH2kCpG9xAAfk6PYjxDOmjt1AmmyMEY5kCsJZ7dcffCQkPTftkIQpHFWChgLCE7fbg== 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: List-Subscribe: List-Unsubscribe: On Sun, May 26, 2024 at 11:22:23AM +0200, Christophe Leroy wrote: > On powerpc 8xx huge_ptep_get() will need to know whether the given > ptep is a PTE entry or a PMD entry. This cannot be known with the > PMD entry itself because there is no easy way to know it from the > content of the entry. > > So huge_ptep_get() will need to know either the size of the page > or get the pmd. > > In order to be consistent with huge_ptep_get_and_clear(), give > mm and address to huge_ptep_get(). > > Signed-off-by: Christophe Leroy > --- > v2: Add missing changes in arch implementations > v3: Fixed a comment in ARM and missing changes in S390 > --- > arch/arm/include/asm/hugetlb-3level.h | 4 +-- > arch/arm64/include/asm/hugetlb.h | 2 +- > arch/arm64/mm/hugetlbpage.c | 2 +- > arch/riscv/include/asm/hugetlb.h | 2 +- > arch/riscv/mm/hugetlbpage.c | 2 +- > arch/s390/include/asm/hugetlb.h | 4 +-- > arch/s390/mm/hugetlbpage.c | 4 +-- I was wondering whether we could do something similar for what we did in patch#1, so we do not touch architectures code. > diff --git a/mm/gup.c b/mm/gup.c > index 1611e73b1121..86b5105b82a1 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -2812,7 +2812,7 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, > if (pte_end < end) > end = pte_end; > > - pte = huge_ptep_get(ptep); > + pte = huge_ptep_get(NULL, addr, ptep); I know that after this series all this code is gone, but I was not sure about the behaviour between this patch and the last one. It made me nervous, until I realized that this code is only used on CONFIG_ARCH_HAS_HUGEPD, which should not be the case anymore for 8xx after patch#8, and since 8xx is the only one that will use the mm parameter from huge_ptep_get, we are all good. -- Oscar Salvador SUSE Labs