Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5875804ybi; Wed, 12 Jun 2019 09:57:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaQVflQapzAUYwYo5N43z+pxlHHDL9GqavlGa67JGxOqzFao8EaXfZoAF6o5oiys98PnNE X-Received: by 2002:a17:902:76c3:: with SMTP id j3mr56165704plt.116.1560358626591; Wed, 12 Jun 2019 09:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560358626; cv=none; d=google.com; s=arc-20160816; b=ODUvwrb2OULA0SheXiYDVq7MKsNgUDUPWYLKiPT53+/5krX2fdkDI+UV/Dn1PVuaGx iLflo0DZNNN9BvriQ5bgbToW6JkZYfTKuT10RUudRCl1hOHURg2zaOvdl4h5cgLt+2Ps Ejoh8cRo+t/nts/WSZD/nvqzX3rtSYG0VwjTMItBGdnxbxe4ANZG39ofx2vXwS5Q+Cd2 1gmrLVk3JUdxVOyISZIUGiEWHEQq22Ez9xS8S16g33oDHEoj+czbqlLcI348ogDTR1vQ xHw9gudnMdk8vTNVI1sdgb9Wc6WGpZlX9oZCUz9o4083E6vpzREcz971rCWUwI1vyJAS tT8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7bkmJXhFF47r5AyND7v53Qh3+Zc2WTWvJCcGjnl+w1c=; b=qXywtHldvjBuji+bFN8Vi7jOKXZlX9N653A4/dr+EzZ95b5LDtG851fhIQKRVeR+J+ as6HPF9+H8KY0RN+LQvAtd9WzHnoybEtcA7VU488sS0gatxVPQQXCTaWQTsUlNbqWiEy rMJfFpN5hMiDXnA7cRGLQ42yC5Nw6K48uGQdKJsBYmolyOuo8eHA8K/qfQyY2VyQT7M7 joijoyDy8n7MPtW0OhwdmdGdF0njiEfj/KrAadLLDJR+Vz0cGZEMVyvNAwyhaW9XFdHN 9f8nIDuI7sQfDHjmu+YUe6a28BVmwfzwNGvyIkz1w3yzcJtbLzTGkhV6flQnF5PH2c5q K29A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si269536pgl.508.2019.06.12.09.56.52; Wed, 12 Jun 2019 09:57:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438315AbfFLLhS (ORCPT + 99 others); Wed, 12 Jun 2019 07:37:18 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40905 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438269AbfFLLhS (ORCPT ); Wed, 12 Jun 2019 07:37:18 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 7C0EA802EA; Wed, 12 Jun 2019 13:37:05 +0200 (CEST) Date: Wed, 12 Jun 2019 13:37:15 +0200 From: Pavel Machek To: Oleksandr Natalenko Cc: Minchan Kim , Andrew Morton , linux-mm , LKML , linux-api@vger.kernel.org, Michal Hocko , Johannes Weiner , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Daniel Colascione , Shakeel Butt , Sonny Rao , Brian Geffon , jannh@google.com, oleg@redhat.com, christian@brauner.io, hdanton@sina.com, lizeb@google.com Subject: Re: [PATCH v2 0/5] Introduce MADV_COLD and MADV_PAGEOUT Message-ID: <20190612113715.GA21366@amd> References: <20190610111252.239156-1-minchan@kernel.org> <20190612105945.GA16442@amd> <20190612111920.evedpmre63ivnxkz@butterfly.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <20190612111920.evedpmre63ivnxkz@butterfly.localdomain> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > This approach is similar in spirit to madvise(MADV_WONTNEED), but the > > > information required to make the reclaim decision is not known to the= app. > > > Instead, it is known to a centralized userspace daemon, and that daem= on > > > must be able to initiate reclaim on its own without any app involveme= nt. > > > To solve the concern, this patch introduces new syscall - > > >=20 > > > struct pr_madvise_param { > > > int size; /* the size of this structure */ > > > int cookie; /* reserved to support atomicity = */ > > > int nr_elem; /* count of below arrary fields */ > > > int __user *hints; /* hints for each range */ > > > /* to store result of each operation */ > > > const struct iovec __user *results; > > > /* input address ranges */ > > > const struct iovec __user *ranges; > > > }; > > > =20 > > > int process_madvise(int pidfd, struct pr_madvise_param *u_param, > > > unsigned long flags); > >=20 > > That's quite a complex interface. > >=20 > > Could we simply have feel_free_to_swap_out(int pid) syscall? :-). >=20 > I wonder for how long we'll go on with adding new syscalls each time we n= eed > some amendment to existing interfaces. Yes, clone6(), I'm looking at > you :(. >=20 > In case of process_madvise() keep in mind it will be focused not only on > MADV_COLD, but also, potentially, on other MADV_ flags as well. I can > hardly imagine we'll add one syscall per each flag. Use case described above talked about whole-process-at-a-time usage, so I'm asking if simpler interface/code is enough. If there's motivation for more complex version, it should be described here... Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl0A4+sACgkQMOfwapXb+vL5YQCghuEijV5YAvkI5fTH2VOxFvri GLwAoJHEuclcX7PmhKr8Ht0OQ4+EHl8w =CpBo -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--