Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp729627rdb; Fri, 2 Feb 2024 02:07:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN6M6bGNxMjgCERzfbmoaT8OixMTaGVq7xJKRZSlyHwjw4G6qMrONQLr4OZRgl2Xzg/iZL X-Received: by 2002:a17:906:6052:b0:a30:3303:e079 with SMTP id p18-20020a170906605200b00a303303e079mr1135550ejj.63.1706868421666; Fri, 02 Feb 2024 02:07:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706868421; cv=pass; d=google.com; s=arc-20160816; b=JF0Cb/IfTsDCdUjWj/CxrXV/FmBxXWSHO9FpEGk2GPzTok6wEJZTvRWp6OUY4Pf0ZX c59zUCx6VvxycGx75LqZDnLuMeUKX+bp9lrrU6/BwFZbjhsrTBl42GiSw0izSFCRr9l4 AXRuWbnmY8dHkmNJPMnghVXgUjfOScTnliTj21maqOxr0d+Lxp//XLiyp9bkv5J0xUGp w85SjGjN3VVgc2kOoVxzssAJA9Hvgr4vT/bzXg/CXjIJNeDOFc5oZk2lJjjmnu9Ozfb3 DoaSLSifRvyw0HRs1FoQ0lbwxMd10RRmS2rjQ5ho7exvVLwtFKkNKqjlYlahRxQQInwU IMRA== 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; bh=Zp39qw0vyC5qpStWLyPfn976MpebyO4rKbzn6LwaTRk=; fh=Ag4VMPspHIs5NeNOtfkSHTCTn3pKX2kFnJ9/ivBNdAs=; b=dHI+nelmwgi2XpMBsuSe9iHc1KJVvlBx+EyG6u1KJIQQB+I6zoyQaajEzbWpO9wlbu wuUpGgBTGDTTDXB211ycEMTO1W+c9BOpEXK9eSrUz+/wuwU3P0cOkGATWrK8GUKQkSY7 8rf7/yAvRe8DclKzlDIMY3Iok3RdNWxuT9f0IO82UCuqfxWoVFhpmynk8JysuyfGdTQj nQvls1lGNdj5nl3frE11pLLbIAgxn3oBVjOzTebkoQZHjo5w13qwqXy/eWP0HwbSAPxM GMtQyutvcUOQWyety1DrPkKPRSxalal1/EQtBzzkwU1Kgb4T+QV9L+Esw0cLm6Qx5mm0 ucQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=h5nEVG65; dkim=pass header.i=@suse.com header.s=susede1 header.b=pHj1cA59; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-49643-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49643-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCX1fbwuIdskCqWSiKWyWbPb0zNL0h2gassalbiLRJkAzAtetc5iq1qLQYruKyhB7WlpkaOL4G0G3+eJWCm0pkWTOozAlGrIk2WRmh6DoQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h5-20020a170906718500b00a36f8de17f4si639284ejk.603.2024.02.02.02.07.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 02:07:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49643-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=h5nEVG65; dkim=pass header.i=@suse.com header.s=susede1 header.b=pHj1cA59; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-49643-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49643-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 50CE61F22587 for ; Fri, 2 Feb 2024 10:06:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CCE17868B; Fri, 2 Feb 2024 10:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="h5nEVG65"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="pHj1cA59" 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 B5E8877634 for ; Fri, 2 Feb 2024 10:06:50 +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=1706868412; cv=none; b=mK1o7k/m6UIGeEa5e0oregxKFDkEVA5lkxVruYGuErJ8Er/kA2EG8DnjdX02HBADLdGVWSxP+7TYsDcC/dQqRAQmK2NMxWSzC2Z0s99tHqd1gFOka6cxOw/oumAIo8CX+smfCosi3nQotwDjDHELJWtYqra21259DT0rBsCT9Cg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706868412; c=relaxed/simple; bh=fuKoY4mbxj5tV35tFZocFtR5lXefrrau5IR3m3GDVrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HrRT97s2ifeeug1mh6pyqGGqlcFPX8uKHEQMM5wFDDJgXwrERfKHFLd/tHz92NJ3PjjTvSlExe245S1Omk7KcjMO0dsi0qCUYvQHZ3kal1BIw3w1TB7buuFxg/WxalDX+bq+xpR+ydIfXIl53wsV8cJP2iQ+SEzVY4eQDZNyNhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=h5nEVG65; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=pHj1cA59; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com 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> 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: <20240201125226.28372-1-ioworker0@gmail.com> X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=pHj1cA59 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.03 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[10]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.02)[51.99%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[suse.com:dkim]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[linux-foundation.org,google.com,redhat.com,bytedance.com,gmail.com,kernel.org,kvack.org,vger.kernel.org]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -3.03 X-Rspamd-Queue-Id: E4AB2221BE X-Spam-Flag: NO 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