Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4641718ybl; Wed, 22 Jan 2020 01:52:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzM3hRGPTugX2m9melwpXG90FnIKjAZVweqQIS0wiqiiBn6fOxVHICsBfkMPzECBz+U267F X-Received: by 2002:a9d:7586:: with SMTP id s6mr6693202otk.342.1579686761312; Wed, 22 Jan 2020 01:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579686761; cv=none; d=google.com; s=arc-20160816; b=zl3oEdVdlsn0SX9RKcF5tDIqFSwTfyJavxgCogXwcZOY0q4AHflF/FfbZ07uMxVm8D +xUqkqzS6EqQKrKno5W7Z8zErPI95nBYwyWtysuslbRTO0UKtwF/PAioC35Gob+4xrS4 REZS5K7roNQnA+ygrkfHoIlW7nVMvq4YqoN8t6xBKreDtJTkzAmo2u+11vBAyGWZI9AC t56pQqe62UeTBGj1r+Zvapurwk2miCdoLDIktAqxa/97qvl1wyEYkH8Wof/GkHFtOlnv B5zyUfd7/yoJR1q+xn/sJQ73zWhAflF9AMXeZkQlKRLVf6dYGWzyK+jIXs+4T7YcDXG7 5upg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:dkim-signature; bh=K9Kz0EYeQrURGwTjiRNoD6do9zmd0lXIO7vywrJCJO8=; b=rmvQ6D74pew3J1RsEqg2jo+ZDRpW1JmmIWj6cC00s9SANZg98JZrVuHQNTuYqPwiSU Y631xXUUSdj5McXI3gLi6vZkdtqFjLgsKmjSY1+/amwnkqeJraatwk6LBroXSpuP89ww eJN3uxdrXz9/xCXl0WZwvJf107t6kNGzAZY4MxixMI6lwCo090lLXe1ouIPygLlc/Nh7 tnevhQ5BEnJumYvL5+wgz8NTeiFqZmYQqm6+Ft+cY3hSSqmHagLBGtc7wZWTo+yxbio9 wTD5bL9xr0X6YMRbq3VYLTdAvXHS1BM2dsOMhysm8spC+QJT6KsqogZai/9XUfxM2Ttr g5kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=uRp6jW4J; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si23874299otk.324.2020.01.22.01.52.29; Wed, 22 Jan 2020 01:52:41 -0800 (PST) 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; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=uRp6jW4J; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732639AbgAVJvk (ORCPT + 99 others); Wed, 22 Jan 2020 04:51:40 -0500 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:10183 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729809AbgAVJhH (ORCPT ); Wed, 22 Jan 2020 04:37:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1579685828; x=1611221828; h=from:to:cc:subject:date:message-id:in-reply-to: mime-version; bh=K9Kz0EYeQrURGwTjiRNoD6do9zmd0lXIO7vywrJCJO8=; b=uRp6jW4JGtw9vMYS5hPKvfYGsFkEcaruIt126ZG1o9X5RVoBqVguBtnE 1TKWRcNJtLVSoog3HSFjAVTs40TJB4RmCnMlBCgnm7x2aTObplckddkKS 8mx9sabNgPXaGiJXhXxBoFCS1cCrNymVQH9sa77bMnnv+mkT9vRY8JD3Y k=; IronPort-SDR: +ZLstp77iXAZO+vQ5DM0SWDzWs9fWxGYhsX8L1GfAcFYl7ljZWGWoubEp3F+ZLyxkgUzMc616p ILsZ+kD1SJBg== X-IronPort-AV: E=Sophos;i="5.70,349,1574121600"; d="scan'208";a="11919547" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-17c49630.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 22 Jan 2020 09:36:56 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-17c49630.us-east-1.amazon.com (Postfix) with ESMTPS id 2D141A1780; Wed, 22 Jan 2020 09:36:48 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Wed, 22 Jan 2020 09:36:48 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.224) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 22 Jan 2020 09:36:40 +0000 From: SeongJae Park To: Michal Hocko CC: Minchan Kim , , , , , , , , , , , , , , , , , , Subject: Re: Re: [PATCH v2 2/5] mm: introduce external memory hinting API Date: Wed, 22 Jan 2020 10:36:24 +0100 Message-ID: <20200122093624.14799-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200122082853.GS29276@dhcp22.suse.cz> (raw) MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.224] X-ClientProxiedBy: EX13d09UWA004.ant.amazon.com (10.43.160.158) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Jan 2020 09:28:53 +0100 Michal Hocko wrote: > On Tue 21-01-20 10:32:12, Minchan Kim wrote: > > On Mon, Jan 20, 2020 at 08:58:25AM +0100, Michal Hocko wrote: > [...] > > > The interface really has to be robust to future potential usecases. > > > > I do understand your concern but for me, it's chicken and egg problem. > > We usually do best effort to make something perfect as far as possible > > but we also don't do over-engineering without real usecase from the > > beginning. > > > > I already told you how we could synchronize among processes and potential > > way to be extended Daniel suggested(That's why current API has extra field > > for the cookie) even though we don't need it right now. > > If you can synchronize with the target task then you do not need a > remote interface. Just use ptrace and you are done with it. > > > If you want to suggest the other way, please explain why your idea is > > better and why we need it at this moment. > > I believe I have explained my concerns and why they matter. All you are > saying is that you do not care because your particular usecase doesn't > care. And that is a first signal of a future disaster when we end up > with a broken and unfixable interface we have to maintain for ever. > > I will not go as far as to nack this but you should seriously think > about other potential usecases and how they would work and what we are > going to do when a first non-cooperative userspace memory management > usecase materializes. Beside of the specific environment of Android, I think there are many ways to know the address space layout and access patterns of other processes. The idle_page_tracking might be an example that widelay available. Of course, the information might not strictly correct due to the timing issue, but could be still worth to be used under some extreme situations, such as memory pressure or fragmentation. For the same reason, ptrace() would not be sufficient, as we have no perfect control, but only some level of control that would be useful under specific situations. I assume the users of this systemcall would understand the tradeoff and make decisions. Also, as the users already have the right to do the tradeoff, I think it's fair. In other words, I think the caller has both the power and the responsibility to deal with the time-to-check-time-to-react problem. Nonetheless, I also agree this is important concern and the patch would be better if it adds more detailed documentation regarding this issue. If I'm missing some points or you have different opinions, please let me know. Thanks, SeongJae Park > -- > Michal Hocko > SUSE Labs >