Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp359261rdb; Mon, 22 Jan 2024 06:32:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhmpVfeD7BukHhwtzFAQfCnte5Tr0ypvX1MmmdOt3zIM1UQr8H/WhN60ioY5rjj9EeYFm5 X-Received: by 2002:a17:902:c94d:b0:1d7:2e86:fb2a with SMTP id i13-20020a170902c94d00b001d72e86fb2amr1967221pla.65.1705933967298; Mon, 22 Jan 2024 06:32:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705933967; cv=pass; d=google.com; s=arc-20160816; b=IiS1bfcMSgI2V4owSjcPW2QGlKzf/i3jyWfPjmzkYYTCDfo+AA+FUlKSrY2q9oMw/2 8PLedCReQXsYgCybJ/Jsp0KOgQ/gMlVzY4FXyi/mr6qIWE3TqLvDtg3FiJgm12tNFdIZ cWXnlpHNqg1waDjvS9hsnQG19EZOr5Ft1bE6w9IJvFiUaTir9J4TS1xNQ7S9SU7HOAg/ Zh1557BQQ2cIDvg8Ixr0YdN/iA/VgcF4a79jNBl8MeZPyI1hVhLrcAY2ZKZz92pmmT/6 LLryW06gpofac1TKdl8YiwKL1ofZdXGnNMfBl/87sUgxPQD3ah97jrVJHmxCbcVBbpML up+w== 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=gJUVDk8RMleasp0nmDcW1YGOWvYqxPQuw9VSvws+tuU=; fh=fHA4HQdEApqTQuNSySweiLw0UA6K0FLdZHa3TytyCJ8=; b=UUbvv3dBTaG8wfRlM2ttZI6tO4X/MbnhMDY689k5JIIHi2/IXhZLLrBjq0ddrb2X5Z wuSsrBkc7mbs5dxG26g6uZv9J+1YWJAUvrA1TNuXHHdm/tKpZPpxzTtmjyumAW7dzLLe dn4pzcNxUES4IASlbKtBKCxSIB+xcignU1zb3uwkhzz9T/lrYU/1cSBgpdkPZj1e8igs p/hXBdmiuEQrHji9y0TiPcNVEejBXB0jCIK1t7VvW9dyiNzfVsHZKy8D8aCYKYzXo4z/ E6ByU4kdpFQVcooHz/jMisZfobK9Wxnb431GoZ+dus/2GbPz7SxOVntp16VR26Z4E+n9 Uk5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ZGmPYeut; dkim=pass header.i=@suse.com header.s=susede1 header.b=ZGmPYeut; 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-33112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l15-20020a170903244f00b001d72ef70315si4439338pls.390.2024.01.22.06.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:32:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=ZGmPYeut; dkim=pass header.i=@suse.com header.s=susede1 header.b=ZGmPYeut; 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-33112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33112-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 49A94B23720 for ; Mon, 22 Jan 2024 13:51:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86F713D0BF; Mon, 22 Jan 2024 13:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ZGmPYeut"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="ZGmPYeut" 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 10C3C3CF50 for ; Mon, 22 Jan 2024 13:50:56 +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=1705931458; cv=none; b=IhARGOgw+lCKheAMyukPALO51NwbXOzKps5fyghfJcG5VimwTiiVUPzgHWVJZQSY5qKaJcoYZFemutCe3vvcBaOADp2KeynT5/RUR7iL5J25v9p1zEZwMl/dz160MmvGWyoxwvA/h3MDT5hvsGggYR6cyeoPBX9K89hB4L4NfMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705931458; c=relaxed/simple; bh=e8szEWsc+dJhLGhEFaoR3PFGjnmG5tJECaeKSzJ0LJk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rV+ymmkWIORm2TO0ump89cmebdv73ulozjlVXAbILEiz+ESX82xZd4JKVHjKmCFn45XgaSASG/4w4Axa9d8z0KqOfRJcHUx7p+sKEuBE+fk6cP9XE8RZskLxy/WGzcpyO8RuuYdlJsdIxZuR0nELz8ogjPb6gi1Bn0BlN+pVu4Y= 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=ZGmPYeut; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=ZGmPYeut; 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 [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 37ADB21DE4; Mon, 22 Jan 2024 13:50:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1705931455; 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=gJUVDk8RMleasp0nmDcW1YGOWvYqxPQuw9VSvws+tuU=; b=ZGmPYeutI1+Lm2slp2P6QkzY7igGN2LeXmJ8jnoqpgwAJsAdiI6i2qzjTEzSGn1l0maGyM GwWP+8p2LFj2ALmOy+v+vEEKvkgDMceU6ij4B12u9E3JQo3/bIoao0Qwukrzic2bCqacQL VAiFFY0aAf/bIZxsInnazudy22OFEiw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1705931455; 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=gJUVDk8RMleasp0nmDcW1YGOWvYqxPQuw9VSvws+tuU=; b=ZGmPYeutI1+Lm2slp2P6QkzY7igGN2LeXmJ8jnoqpgwAJsAdiI6i2qzjTEzSGn1l0maGyM GwWP+8p2LFj2ALmOy+v+vEEKvkgDMceU6ij4B12u9E3JQo3/bIoao0Qwukrzic2bCqacQL VAiFFY0aAf/bIZxsInnazudy22OFEiw= 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 18D2213995; Mon, 22 Jan 2024 13:50:55 +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 7x4XA79yrmVOSQAAD6G6ig (envelope-from ); Mon, 22 Jan 2024 13:50:55 +0000 Date: Mon, 22 Jan 2024 14:50:54 +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, mknyszek@google.com, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] mm/madvise: add MADV_F_COLLAPSE_LIGHT to process_madvise() Message-ID: References: <20240118120347.61817-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: Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [0.40 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_SEVEN(0.00)[11]; FREEMAIL_TO(0.00)[gmail.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; 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)[]; BAYES_HAM(-0.00)[32.84%] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: 0.40 On Sat 20-01-24 10:09:32, Lance Yang wrote: [...] > Hey Michal, > > Thanks for your suggestion! > > It seems that the implementation should try but not too hard aligns well > with my desired behavior. The problem I have with this semantic is that it is really hard to define and then stick with. Our implementation might change over time and what somebody considers good ATM might turn int "trying harder than I wanted" later on. > Non-blocking in general is also a great idea. > Perhaps in the future, we can add a MADV_F_COLLAPSE_NOBLOCK > flag for scenarios where latency is extremely critical. Non blocking semantic is much easier to define and maintain. The actual allocation/compaction implementation might change as well over time but the userspace at least knows that the request will not block waiting for any required resources. -- Michal Hocko SUSE Labs