Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp581138lqb; Wed, 17 Apr 2024 05:31:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+N0Qimh6c510Fkt77yN+fPDKliH2dSt4yBOIwLic4JbxPoQabrcSySdwFaiMWFvkdQHNpAqW1PuTGq3QeXbV2t5W84CcSrCmotGSSQQ== X-Google-Smtp-Source: AGHT+IHSoHXm1Ge8Q5Iqn2YEIIrwT0XjhNp/DkL1cSTorl0DYp0rldAj7i8qA+gVcIZia6Bxffmn X-Received: by 2002:a05:620a:5785:b0:78e:df05:31df with SMTP id wk5-20020a05620a578500b0078edf0531dfmr10934267qkn.46.1713357116784; Wed, 17 Apr 2024 05:31:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713357116; cv=pass; d=google.com; s=arc-20160816; b=DBVWwK0Z8zzlWaPP6Pv/zrg4jpqiguXcOLak8Oa9slxpuSqtHdcUnPAzyhIBPCRbHc FQHlybfh9642M7HxP5AovmGkv0P91wwU+RBxMqTsJ/l2dgBUi5do7v87Afawq+YvjiFc +Vo3in03G/CTpDcbA0JxXzyQyeRGyDHWbRZNt2x2CkwiZ774BF75jUeykOoD+sEy5MCm YLTXGd/fZmh//mPBZ/EkiDBvN3/5wRz+lXgloncfM9iZaZs0ueYtQGL1ATKrJT3wjtXd jIobllpOhHlPFCK7G8b/GpbHcuxFrrdmNV7oRhohRC6/ZvQ2s2xNh7l3on+689jNMKFy qUvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=5L4Cpqhji1dUxreeRJmUVcGAtVBWN1z//jlv1xmcGEE=; fh=aJE2Oyf1ivB0jo/C6IgMrkuH8X5sNAvG0q6fBuX6/rc=; b=CRXtOv91Iupj/SU0AAo9RvrQrAgC7i6iRUYQTsyigZiqNDHktrYKn3emYSduJVw7d+ U53TAWBEfPksmzhfJcCqGsWh76D8nXArXzT6qiNLcdlmcYJpDgVcW4ZM2MbMFr2TOhBL 5Ck1Cega/qTuI5GgNGlznf2dT0uhRK3fEpQbMuxU9SGyE+ymjI0h63iz8oUOs8hAQ3+N Ra4PXXsUAIIwnCzl5Tg49qSLQ+7VCvubZ+alB/uTL9R7Bo/EriXsA7b3LBdiq5o9GU3q M/1NkSrirosxiM5tsk7jIlnDH4CWw2TcE3ieVqDt1HGIlhBBkmPUmuDOPhldw6lXRkBO Wifw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1iD43Ece; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1iD43Ece; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-148478-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148478-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g12-20020a05620a40cc00b0078ee852d752si7613032qko.404.2024.04.17.05.31.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 05:31:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148478-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1iD43Ece; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1iD43Ece; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-148478-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148478-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 82DF11C21616 for ; Wed, 17 Apr 2024 12:31:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E2AD84E01; Wed, 17 Apr 2024 12:31:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="1iD43Ece"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="PnkGW4IO"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="1iD43Ece"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="PnkGW4IO" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4542B339A0; Wed, 17 Apr 2024 12:31:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713357107; cv=none; b=GzPgIkdwPA1IZ17UUzWQ9Qxku6nMPGxZC/2qh1oJVz9zNtyMtrw/LnuvvWhVrWAKkHBUt8uHYn32v2SsDcPYNAS8vBgF76bdQoxYWFIg+YpgDp914KNgBhbcgTL+8jnouTCuX3OuVaBv2uOkgSAS2dgExcaj5K5fPV8/lfTXMX4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713357107; c=relaxed/simple; bh=rXUcUq9+KUqvE6a58BxJUPvJs1UlmFH6ez+k9PbJlXI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mAOqNZqf491RnzeIObOJg0TLyRWPIhXbdGQiUeuh6zLqxLjLvuC8ZxMcmpHb6xFa2tgDOGH/PfE29EczD4gjP9dCoDDgt5yw3oMhw8xCUNQR61zJJfg+ifT+VeHD/GyNqd2yVdz4xiGAQTU6juDuV24YX8gESDMpzSecRCzdzic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=1iD43Ece; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=PnkGW4IO; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=1iD43Ece; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=PnkGW4IO; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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-out1.suse.de (Postfix) with ESMTPS id 3F6DD33C42; Wed, 17 Apr 2024 12:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713357104; 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=5L4Cpqhji1dUxreeRJmUVcGAtVBWN1z//jlv1xmcGEE=; b=1iD43EceviFz+KY05gM4FjqkaP3J7tV1tRqKcpl/FycpA1bIkaqvRUxh83HFXUkkEYABzn 2Zq/qzk2EH4AHjBtNpK0owv7BUHuogUVIhcbQDwjW1eiGvmRoRilM3pYrfRKANt/U7UEFg FiIPUq6AmWzsc4FAgOBCFn80ucxCjjY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713357104; 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=5L4Cpqhji1dUxreeRJmUVcGAtVBWN1z//jlv1xmcGEE=; b=PnkGW4IOEXnDPviFaQWfyO2xr8qX1ttY0BiMCF6uvBFlGEAPhVfeLqKFJWQglXNi7HSt2n QKsuL4AofQJ2h+AQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=1iD43Ece; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=PnkGW4IO DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713357104; 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=5L4Cpqhji1dUxreeRJmUVcGAtVBWN1z//jlv1xmcGEE=; b=1iD43EceviFz+KY05gM4FjqkaP3J7tV1tRqKcpl/FycpA1bIkaqvRUxh83HFXUkkEYABzn 2Zq/qzk2EH4AHjBtNpK0owv7BUHuogUVIhcbQDwjW1eiGvmRoRilM3pYrfRKANt/U7UEFg FiIPUq6AmWzsc4FAgOBCFn80ucxCjjY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713357104; 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=5L4Cpqhji1dUxreeRJmUVcGAtVBWN1z//jlv1xmcGEE=; b=PnkGW4IOEXnDPviFaQWfyO2xr8qX1ttY0BiMCF6uvBFlGEAPhVfeLqKFJWQglXNi7HSt2n QKsuL4AofQJ2h+AQ== 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 D846A1384C; Wed, 17 Apr 2024 12:31:43 +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 j187Mi/BH2bKHgAAD6G6ig (envelope-from ); Wed, 17 Apr 2024 12:31:43 +0000 Date: Wed, 17 Apr 2024 14:31:38 +0200 From: Oscar Salvador To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Muchun Song Subject: Re: [PATCH v1 2/2] fs/proc/task_mmu: convert smaps_hugetlb_range() to work on folios Message-ID: References: <20240417092313.753919-1-david@redhat.com> <20240417092313.753919-3-david@redhat.com> <209b1956-a46f-41aa-bec1-cd65484f36cd@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <209b1956-a46f-41aa-bec1-cd65484f36cd@redhat.com> X-Spam-Level: X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; 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)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 3F6DD33C42 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Score: -4.51 On Wed, Apr 17, 2024 at 02:18:10PM +0200, David Hildenbrand wrote: > On 17.04.24 14:09, Oscar Salvador wrote: > > On Wed, Apr 17, 2024 at 11:23:13AM +0200, David Hildenbrand wrote: > > > Let's get rid of another page_mapcount() check and simply use > > > folio_likely_mapped_shared(), which is precise for hugetlb folios. > > > > > > While at it, use huge_ptep_get() + pte_page() instead of ptep_get() + > > > vm_normal_page(), just like we do in pagemap_hugetlb_range(). > > > > That is fine because vm_normal_page() tries to be clever about mappings which > > hugetlb does not support, right? > > Right, using vm_normal_page() is even completely bogus. Usually (but not > always) we have PMDs/PUDs and not PTEs for mapping hugetlb pages -- where > vm_normal_folio_pmd() would be the right thing to do. > > That's also the reason why hugetlb.c has not a single user of > vm_normal_page() and friends ... it doesn't apply to hugetlb, but likely > also isn't currently harmful to use it. I guess not because we skip the special handling, but I agree that replacing it is the right thing to do. Thanks for explaining! -- Oscar Salvador SUSE Labs