Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5752999ybi; Wed, 12 Jun 2019 07:55:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWKR/5k65rGUib7Bb1sB5xm+1ciCyQvYXb4FeA7KGZDmFEF5hT68q+fTkjdgGJd2O6YhJS X-Received: by 2002:a63:26c6:: with SMTP id m189mr2382323pgm.2.1560351354002; Wed, 12 Jun 2019 07:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560351353; cv=none; d=google.com; s=arc-20160816; b=JV8HKx2miY1gwlLiaX+I5rAdxZ54LH8hhjahdZQiAuC39LbNv+EDIBG+SdNjg+gr3X npknOHcWTEQ9VOpwzvROeoV7m1iyeIbsE6wf+noQk1+c6goUcqg1DYSjQhjyZLc2TW+L ZTn93sM/+eDIhNL4v4rYJ/fi2pp7uNuXLcYDjtlUNN/SyHZViaopD+ICWDY7zqQ0+uhg Yu0AYGJP+Y/RL1cgSIaS3xSWWoMjcEEgo4cIPc4pbndFjHWvP8o57oh6IsbRv5vzUNpl 1TxKwor3kJ0OxcKadVz/uwRXfpCo+ysazY9NS1oHxID5Lh5mVtWoYTNA2GrldiCxk4ZF Gx0g== 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=upe1KY25v3hgXKp8rEn9QptXzfb5Mmzs2by7mfJ5TOA=; b=LoiXbJBjLTPWjUjSmGPE4t+FR61HFOf5o0goD0StL54/4/OP1YXncajF3IdhHu+tlS 1rjfmlft+cgE5FZAyXkqPjvs8w4TDk7CYoU9C6aQn6tu6WJ7q2JtqS597oKANS8xP5ge DN9E8oclVAuX2ZvQOdcL67NYzZFcTV77iET0qeBeTBOL+0Z9raFA1brXHeLRT7NIqVEQ G+qNONHU1akh5lBu1/gHerrFCbyrSviziCQx4eEzORw/aWze0sSNuSeWbMNxgaSuS3jJ PtFBYb1xT1ICE4lEvB0lELJs1LHHGriduXRN+UeUEOlbUvh4jvnS42q5h9ZdPKS7eBzh 0ikw== 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 u18si34555pgk.506.2019.06.12.07.55.38; Wed, 12 Jun 2019 07:55:53 -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 S2438108AbfFLK7t (ORCPT + 99 others); Wed, 12 Jun 2019 06:59:49 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:39803 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbfFLK7s (ORCPT ); Wed, 12 Jun 2019 06:59:48 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id F2751802E0; Wed, 12 Jun 2019 12:59:35 +0200 (CEST) Date: Wed, 12 Jun 2019 12:59:45 +0200 From: Pavel Machek To: Minchan Kim Cc: 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, oleksandr@redhat.com, hdanton@sina.com, lizeb@google.com Subject: Re: [PATCH v2 0/5] Introduce MADV_COLD and MADV_PAGEOUT Message-ID: <20190612105945.GA16442@amd> References: <20190610111252.239156-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <20190610111252.239156-1-minchan@kernel.org> 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 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > - Problem >=20 > Naturally, cached apps were dominant consumers of memory on the system. > However, they were not significant consumers of swap even though they are > good candidate for swap. Under investigation, swapping out only begins > once the low zone watermark is hit and kswapd wakes up, but the overall > allocation rate in the system might trip lmkd thresholds and cause a cach= ed > process to be killed(we measured performance swapping out vs. zapping the > memory by killing a process. Unsurprisingly, zapping is 10x times faster > even though we use zram which is much faster than real storage) so kill > from lmkd will often satisfy the high zone watermark, resulting in very > few pages actually being moved to swap. Is it still faster to swap-in the application than to restart it? > 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 daemon > must be able to initiate reclaim on its own without any app involvement. > 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); That's quite a complex interface. Could we simply have feel_free_to_swap_out(int pid) syscall? :-). Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl0A2yEACgkQMOfwapXb+vK7ngCdHTHlKgNthsiwMrKqz+jDGcDZ sfAAn1C5KLFMD7cpycS9Ep2CWeYprU8B =j4LI -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx--