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 C6512C4828E for ; Fri, 2 Feb 2024 10:06:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EDB76B0071; Fri, 2 Feb 2024 05:06:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CF1C6B007E; Fri, 2 Feb 2024 05:06:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18B816B0080; Fri, 2 Feb 2024 05:06:53 -0500 (EST) 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 0853C6B0071 for ; Fri, 2 Feb 2024 05:06:53 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D1F7FC0EE1 for ; Fri, 2 Feb 2024 10:06:52 +0000 (UTC) X-FDA: 81746435064.10.5E06E4D Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf30.hostedemail.com (Postfix) with ESMTP id 9989A80017 for ; Fri, 2 Feb 2024 10:06:50 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=h5nEVG65; dkim=pass header.d=suse.com header.s=susede1 header.b=pHj1cA59; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.130 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706868411; 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=Zp39qw0vyC5qpStWLyPfn976MpebyO4rKbzn6LwaTRk=; b=zYx5OYt9s/kPQDbtw/qPAr0HxgYSKGwW4+dB0vHBRvg2h5fWILRQPwKtga3kWeCCq/eA/P FjVippfcQhBcDrNJU46OnJZWkkN93fxIIyXaMwfZYwVYdGTXK9AYLZHFOqgf3HI2F9a9cO 57513KyUFxQqjhRE20Oo0X8pdJfcLTw= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=h5nEVG65; dkim=pass header.d=suse.com header.s=susede1 header.b=pHj1cA59; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.130 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706868411; a=rsa-sha256; cv=none; b=vC8DeMQR2qFhd4NviVYYwk5+c5UQmwBIOrR3phcI8c6N9E2ZzFwTmlNUoZxw4b7/tos8bM +0MusZIm9i1kChj0Za/lK1aTiLT1dfkBq7EgVajyHVweNFWhk4esHyFP933+w2RRjWgIeY ywexbdiUvzXQTXoB7XW4MX2GkTIdXlk= 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 E4AB2221BE; Fri, 2 Feb 2024 10:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706868409; 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=Zp39qw0vyC5qpStWLyPfn976MpebyO4rKbzn6LwaTRk=; b=h5nEVG650NBZwy9STqPacXwisn2rWSXL2wDfvdo8HrS1YKRIcdyZ9cSLRll6bnCTpkVQZR +yXRNRR8uZMrzv0nq5fpArBU+G40D7h+Jnjc+yENDqOlBV3BG3mNjaiEnJE6A104GYWs2z U9X5Sgo5qrKkck3IzeODEHmCjKa6mXk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1706868408; 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=Zp39qw0vyC5qpStWLyPfn976MpebyO4rKbzn6LwaTRk=; b=pHj1cA59U4F6WUt07t/FI9xkJmJRhAMg8D2ulzUNVaaTiGpFgHTVxETPBcZ6sund0I3JWR 2eF0S/cUsHgayWfgH8tgtVEtwrgKmT3d4vauutZymMQF4z8xJnRGeGs00cx8oIKMt/hyeX dB9FqQqqDkXW6IYeWYowlQCs5aHszS8= 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 C616213A58; Fri, 2 Feb 2024 10:06:48 +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 tgSPLri+vGXmWAAAD6G6ig (envelope-from ); Fri, 02 Feb 2024 10:06:48 +0000 Date: Fri, 2 Feb 2024 11:06:40 +0100 From: Michal Hocko To: Lance Yang Cc: akpm@linux-foundation.org, zokeefe@google.com, david@redhat.com, songmuchun@bytedance.com, shy828301@gmail.com, peterx@redhat.com, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] mm/khugepaged: skip copying lazyfree pages on collapse Message-ID: References: <20240201125226.28372-1-ioworker0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240201125226.28372-1-ioworker0@gmail.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9989A80017 X-Stat-Signature: hzas6n3ytxmi33g6ctiosr5e3r1ffmog X-Rspam-User: X-HE-Tag: 1706868410-878598 X-HE-Meta: U2FsdGVkX1/Tdbg7/5Ih4LgfE1YjgfguDlFOwwlt/M+hpH3G1yYa32L3e0+btNMPq6BDOlpcKbWWNmrdFELwi+q8pZ3erLmY3fWPM8OWBIPQ/tW7gZZi3qfniC6/NaVJDjFIeC72gZ2S4Qhfujp52GqrqYhGiO9fxGYdMbHkyx/2O40fGJMz+Bu8zcsYNYPrEVcBDXDmxxMDaw2QUQFCOeqApPJma6zK4rVFb2Ism9ZztD73naFcC4oV4/lXBOndDZiPS8h+A0gsE1O61Kzv/k9b2Z8wNdFG3KsmmLtNlZpM0ZWS8nVQmTGsPfdDUFR00J47K/QjNavZ9R69PQoMB/0+hDC8KXkoiCCjCnXXB1Wg2egJFiqMO90r1CmiaAFla3QwpTLwrgwNmFt3wPSxbr6W9YHq0R2/HW+rOxaNdr8lx+WEtTG3dIOzQD7b4k0QDdAZ/cJAkW6Q+xsWnrjmsHBUOOKCE/H3WUDF57bFluLXRcn4pY+mP+IdPE3SRhIxvo5X/8xxUKvm6WOMrb6AOtjpPtDPxj0e8cIbKtV66gq3qbb9af9xofMS1JgrE5BlJ2ip5BHTpWuswTUMWdKUevtz/SPQvardPC/9HlJTcxIMhH7IdiCZ+hsMDbznERDEAtZ+gthxnV1rtfZWSaHUqG10bWDanbNeqfnBN5w/PA+23DKtCAfrs82qP2zyMbgzji7wnLlku6hYfQ+ELsYx3B3/myxPpXtjN1tToUf5iqTDXklsW8n9100MhWvAZIRf4RT2r3PBKef4FMDWm4yHBKJndlXjmi5nDzS106Oh3hJsLrNjclYJcDV20aUGYGUNbu/fuBMLr3XLiLkWpyqDxQKRyOFyKoyiCiDBp9tMV6GOcgOpxNNccUE9JNQpI3Olwa0L8og1IOCFiIgrxzbE+SR9G6wLuysGfrvvngW+f1Lvrv8K8c2pU8x7wXEYV0FggZ1MEg79fjx8Nx8kvhd yNaegCA2 qT+WuayU4MUqJEduZAQmjedW9bQy+ZtTfO7W1brK97S/tzk3P7VL7srJWYUPJZ1Ib8DD1+Su/mgIunVn8xKRCU6gk7ip8TGYDvVUPnA4+ury8xEweRdMdA0VroJCRBDrzmBIjCL2RdfkquGt1Hg00lb+/6f1YYDT1WHdqv0zdjCMymWnHyTQAYtZAbu2YrauNDtXAGHKOK59Ff4zwxdoSHgUtkA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000090, 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 Thu 01-02-24 20:52:26, Lance Yang wrote: > The collapsing behavior of khugepaged with pages > marked using MADV_FREE might cause confusion > among users. > > For instance, allocate a 2MB chunk using mmap and > later release it by MADV_FREE. Khugepaged will not > collapse this chunk. From the user's perspective, > it treats lazyfree pages as pte_none. However, > for some pages marked as lazyfree with MADV_FREE, > khugepaged might collapse this chunk and copy > these pages to a new huge page. This inconsistency > in behavior could be confusing for users. Is that any more confusing than collapsing pte_none pages? TBH I do not really see why this is a problem. MADV_FREE are correctly recognized same as pte_none so the user defined trashold applies. -- Michal Hocko SUSE Labs