Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp360741rdb; Mon, 22 Jan 2024 06:35:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDkYs8WbVTSexrc7mKEMj+d28HB03eLZUWVHPDiFYgSHQ3uXRq1ptryBe5WBfNyVA21/Ha X-Received: by 2002:ac8:5802:0:b0:42a:488b:1d2c with SMTP id g2-20020ac85802000000b0042a488b1d2cmr366552qtg.3.1705934134722; Mon, 22 Jan 2024 06:35:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705934134; cv=pass; d=google.com; s=arc-20160816; b=fPFecWs6kgzVgFAQhnUtxbLIJZghfPZUViFtw3LqHiln9RdYJy3eUqkOeoZ5JAfymG tj6vfglM4aW7LWPMRfnwTpQLAyWVdJXmnA06CFf3vJPWaMgu2OEKRw+MWGfUO1gcF0os Qhw77Dk856gJL894mvJ4Eks9GGOYriMtf+RdtbR0NHv2UT+FRsuXdBoMsUArejnzZP9r JHHKVtFNL5WpnjQuBH82ropmWYBHImo9oJYogK4Rp053MQF+klWA1bpCK5OpN9YiQGS/ VANcN5p4mChLe99zGuaCiEcKst7N706rHytU289c/GGyyeXvZ65QRs9ongPga7d++XGl 27Jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Og27EideGjz/YmHYDhgkpc8f4ToRAK905gCq976BynM=; fh=2/mYE6ei7EXQ5MGDxt4X7BQhg9XWgXO70QGvjHN1xuo=; b=a4ldoay2fnpm+QcMUxkbBjWyAutt+xSlEtlKmCBt3QTa65GbucdXN2EuMLwTfEu2We GiuKMN3KUrsqHua8ll23txxfv/ensIoiG27o/6tcCj19HaqjrdS9iLBgm2sk9YdkTnqK 7TDrnNGPbo6/a5clBvzdLvRnnads3Gl5+Mht8EEsnPyS98A0YTslRorrFacFnPxhIILq GI10i+cK16+9La3ZItyq9JQBhxodTtr4nnhyMCjp+AHyWfJIduP6BrdDpjt3E02g06m+ oI+7c27q/K/Fykymk2PfsJ66mWrvjEYHC3rvRX1kOsiz3/gDCJhuo2uLNTVFF6wr1six Zqmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Ml/CNM8Z"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u14-20020ac858ce000000b0042a28bb6eebsi5860105qta.470.2024.01.22.06.35.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 06:35:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33168-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=@gmail.com header.s=20230601 header.b="Ml/CNM8Z"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 261E81C21C86 for ; Mon, 22 Jan 2024 14:35:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38BA93D54D; Mon, 22 Jan 2024 14:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ml/CNM8Z" Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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 2455F3D544; Mon, 22 Jan 2024 14:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705934105; cv=none; b=tEA4QVlE7oEghfMT62vBdme+3wAchylzGIuLzrvFrwypA8W5ZRWfYSmjT+yAEpvOCl2qjQN/FJuGw1cf+4oX9Id3v0uV7YlRGK0UvgPkw/6tQ62m9t0bNc4hYDcF5deOBj1bHhUaW65e1CxkgNks7TsRi6ihakpwR4Yp1PtCo4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705934105; c=relaxed/simple; bh=Og27EideGjz/YmHYDhgkpc8f4ToRAK905gCq976BynM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UyLD3nV/Hz8v1sPaWIPwswOixJsJeBrN6G/5vqffGS7YIJYnCG1vdtEGW8MVVgz2yMY8WsJGbenZZDEReSd4AXvjDaMMOqQDAo3COXmhsMZFJZXCgHJatcuBFYrO/3IFuXR4RFkbl8dfzC0rxP2txvGA58L67+BM4D7y5USePtg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ml/CNM8Z; arc=none smtp.client-ip=209.85.219.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-d9b9adaf291so1892946276.1; Mon, 22 Jan 2024 06:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705934103; x=1706538903; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Og27EideGjz/YmHYDhgkpc8f4ToRAK905gCq976BynM=; b=Ml/CNM8ZE7rLoRqUJHGVrQcv1bQmof6YzHypIJhmERAPojJvfuE8bB26d53dkOyRBI XinfoLTdmR4k/1Re+p3lNZbaFPTQV3Y4pa6R69/dJMaX8YiOk2WwHbTVNbpxzWyplW1H Avi3lpLoVzPLdd4V+tRVimIzZzV3IqLYPLqmQC+fRhlGoJxDh5mW1yGCxIIbhgJbVaRm UyjKa/gfQQpbFEP/qjaVgdK6Ia733EqeZjLRHeWupvf6vJB0lEIUi0ZXO2Izo2GIB9SR waTslOVyjdvJlT+8Dwv0XkyqMRFHK1hXZYzWWAghzTnluQ90NkffgVCZ+hELm6hlXiWX WVSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705934103; x=1706538903; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Og27EideGjz/YmHYDhgkpc8f4ToRAK905gCq976BynM=; b=eXCvxpAFNFY5sfe86geUCDRe1yxC+qlN84mmq4c76BtD/ZlpNtTZhcPBENvbpW+pTG 8l8An91qkoT+8Q27vE2fQpD7aBCzFUsiAJK3TtC5X4+YCngkTexOsY2RFnH7Ayv/RKoX 7zdKZEEmmSjXYLcjvIgaaMflUnpHFsmQz4l/5cPhs8JHyntXIAGIxjh2MCCj3sRu+lIO mftkB5Egq9EU8ZqK7/yCUigJFV1yWpmsDKts8fxchqFBNsx+IgMBUsM1o7ieSm8hyKLU ArKYmY/J4f06X8xt1cjXFypmaSU9/Tdg7vGBzgsQU7etoE4EaDoESjbpc4D7lPz/opII P3QA== X-Gm-Message-State: AOJu0Yyc75gq+todhHcyttED1yvVI2F8UQFiclXTMjRsE1KdhOL7Hi// XOVDP/W2d8Mqwc2Zo6kt95/Hm7xBw3i7Z7KvUzw7CgIUZ1WNT30mN+8eitD2/PUXpJXxDJaM4Qr hjBaFBlcGdhflc0FzUUbhGvabK1w= X-Received: by 2002:a25:aa4a:0:b0:dc2:2e4e:d36c with SMTP id s68-20020a25aa4a000000b00dc22e4ed36cmr1393429ybi.37.1705934103029; Mon, 22 Jan 2024 06:35:03 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240118120347.61817-1-ioworker0@gmail.com> In-Reply-To: From: Lance Yang Date: Mon, 22 Jan 2024 22:34:51 +0800 Message-ID: Subject: Re: [PATCH v2 1/1] mm/madvise: add MADV_F_COLLAPSE_LIGHT to process_madvise() To: Michal Hocko , "Zach O'Keefe" Cc: akpm@linux-foundation.org, 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, linux-api@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Zach, What do you think about the semantic? Thanks, Lance On Mon, Jan 22, 2024 at 10:14=E2=80=AFPM Lance Yang w= rote: > > On Mon, Jan 22, 2024 at 9:50=E2=80=AFPM Michal Hocko wr= ote: > > > > 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 w= ell > > > 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 fo= r > > any required resources. > > I appreciate your insights! > > It makes sense that a non-blocking semantic is easier to define and maint= ain, > providing userspace with the certainty that requests won=E2=80=99t be blo= cked. > > Thanks, > Lance > > > > > -- > > Michal Hocko > > SUSE Labs