Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4272191ybl; Mon, 13 Jan 2020 10:45:36 -0800 (PST) X-Google-Smtp-Source: APXvYqw+aKpdFbvsxji4VxCoLVVd+tMkL6g8BD2sD91tTj4YO7goO5AFCCo1TquqAVqPRyPCberW X-Received: by 2002:a54:4106:: with SMTP id l6mr13106368oic.76.1578941136358; Mon, 13 Jan 2020 10:45:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578941136; cv=none; d=google.com; s=arc-20160816; b=W6Qqz1RM1PZiTdZdkQPy5fUNoyHCFK2gK8lxLAPEZXQAJUrZ3wUafUDpFKDu3cq0I5 JardkWzoYklkM5t3tPkpMFuOAgeAm2Gj72Un1o2C5jueSVmcsXQl4j3QeqcESEnLh3ep PjOas3pBouVR/JDlJwqjKfwllJTPyAvl8TrmNfSidLDwLoFMEK42Qc9vs59dozOAj3bi keihZ3D/AxiOAtE+Rjnlq/JcsMh91wzrOdNqtVBzuukxSu3K9otIIIQCGSzbnBPXkT49 Z2olnIhEW8utlGg6ZGeeGZSTfVJpSPUz4HNdw6uo8eWcBcHRKkhVGywKcuNfgY+mozjV dT5A== 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:dkim-signature; bh=XCFW0Yfpgoj7tyuIPW7yq6i9Mkax8uk0L6HzdUrT4A0=; b=MGhRsY5F9gUM1Pw8RZY3Sof6JOL/paS8HmzoCaousdFoAjw2VQ4zZmHped+I3km+J2 3wiVpWfENUxX4UUI9dn8hs2/awPOQs898DgPW9c9lUyQLBf+vKoszVikiTamMLepG/YU i6gBgQy0cb86nJgsuO748k0LCGgAHXbq42HDgPUbE8eNxfocAzPIerzLIYRkfMG175gU m3Vo1vpLrC1iNmVaaBr8rXEJ2yhvGh4wGfWaZ17U9US2M4CDx6cHP0jLLN0TNtcHYtZt f51v4stxnvmwxAQRe93vMKkO9Twy5Bd+oh4M9UZjjS6kfoAKXlpBBRGDMIU7DubpXUPJ 5IrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=UmiF87Pm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si4800441otf.84.2020.01.13.10.45.23; Mon, 13 Jan 2020 10:45:36 -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=fail header.i=@gmail.com header.s=20161025 header.b=UmiF87Pm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728778AbgAMSoN (ORCPT + 99 others); Mon, 13 Jan 2020 13:44:13 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40351 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728664AbgAMSoM (ORCPT ); Mon, 13 Jan 2020 13:44:12 -0500 Received: by mail-pg1-f196.google.com with SMTP id k25so5112837pgt.7; Mon, 13 Jan 2020 10:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XCFW0Yfpgoj7tyuIPW7yq6i9Mkax8uk0L6HzdUrT4A0=; b=UmiF87Pmy7EMCj5XCheHSLZsszlG5ZSZMFIh7wiSNffTKrTM5HIFOk5tBwvl4jcvhV MCMl1R1gjAmNlaPSREuj0dM3j5ZCV+zPUSGJ01CAu5cDgZY5wrLKXX6tQF9HjnOPVeG4 HVsd2tUXtKOOMu3JMD+63nTXdMheehqDAdP6SHAPVg5EL6yJzMyxhWUrwRpPur6OORsF t0zFoA7NHCANedW4Ksf5Rje8n8dhVSNb1rhp8ENxsfstADzq4tydyeyqOCyChA1tEO2Q mZDSO0H3AmCQRYCR3WpE82jA2FusRTPPMlHy3HYsT/+d8xQTOFYYeqkH7AgG+WipvJ9G ophg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=XCFW0Yfpgoj7tyuIPW7yq6i9Mkax8uk0L6HzdUrT4A0=; b=KJekepyI153Ti0ayNG6ESLtPw6QXhZ2Db0eLxcd8q9JWzCW2TusaRHEb3b7p9TErCn xK14+g5es/mHY22T/KFxJGOW+zfnUveybkAagidA3WhYWcdEMK+m0Tzl9fBYOzqVTFsb /91Xbp4f9SvJd1bT52Tkn1ocTBlzMMo0nyEbftFGf4sWihd++ua56f0VStQgAhr+HOqa 48X+OTnDKpJM1oBycNnfkkHEqmvY1EjVExCENpyjodx+n++XF5eQGJcyBYvrNQqC7Dym 5IaUiGNU8v8dMPFb35OR3Fa2MMvwCz8ftXv9DqqB4Wqed+VcvgJ+LKh+LLtZjV8fMBEq eF6g== X-Gm-Message-State: APjAAAW1KK0/mE0Y0SdG71bP5i4pXPf0ocoqfsswVK+6UstFOZidVZhV +8YocLDHjVN7sgnAO8PWJoU= X-Received: by 2002:a63:a357:: with SMTP id v23mr22421783pgn.223.1578941051972; Mon, 13 Jan 2020 10:44:11 -0800 (PST) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id a16sm14152648pgb.5.2020.01.13.10.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2020 10:44:10 -0800 (PST) Date: Mon, 13 Jan 2020 10:44:08 -0800 From: Minchan Kim To: Christian Brauner Cc: Kirill Tkhai , Michal Hocko , Andrew Morton , LKML , linux-mm , linux-api@vger.kernel.org, oleksandr@redhat.com, Suren Baghdasaryan , Tim Murray , Daniel Colascione , Sandeep Patil , Sonny Rao , Brian Geffon , Johannes Weiner , Shakeel Butt , John Dias Subject: Re: [PATCH 2/4] mm: introduce external memory hinting API Message-ID: <20200113184408.GD110363@google.com> References: <20200110213433.94739-1-minchan@kernel.org> <20200110213433.94739-3-minchan@kernel.org> <56ea0927-ad2e-3fbd-3366-3813330f6cec@virtuozzo.com> <20200113104256.5ujbplyec2sk4onn@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113104256.5ujbplyec2sk4onn@wittgenstein> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 13, 2020 at 11:42:57AM +0100, Christian Brauner wrote: > On Mon, Jan 13, 2020 at 11:47:11AM +0300, Kirill Tkhai wrote: < snip > > > > +SYSCALL_DEFINE5(process_madvise, int, pidfd, unsigned long, start, > > > + size_t, len_in, int, behavior, unsigned long, flags) > > > > I don't like the interface. The fact we have pidfd does not mean, > > we have to use it for new syscalls always. A user may want to set > > madvise for specific pid from console and pass pid as argument. > > pidfd would be an overkill in this case. > > We usually call "kill -9 pid" from console. Why shouldn't process_madvise() > > allow this? > > > > I suggent to extend first argument to work with both pid and pidfd. > > Look at what we have for waitid(idtype, id_t id, ...) for example: > > > > idtype == P_PID > > Wait for the child whose process ID matches id. > > > > idtype == P_PIDFD (since Linux 5.4) > > Wait for the child referred to by the PID file descriptor specified in id. (See pidfd_open(2) for further information on > > PID file descriptors.) > > > > We may use @flags argument for this. > > Sorry for chiming in just a comment. Overall, I don't particularly care > how or if you integrate pidfd here. One thing I would like to point out > is that we're working on a patch to place new features under pidfd > specific flags. This e.g. means a pidfd would be only be able to be used > for madvise operations (or getfd operations) if it was created with that > specific flag set making it easier to share them with other processes. > So if you integrate them here I would be quite thankful if you target > the patchset for the v5.7 merge window, not for v5.6. Hi Christian, Sorry but I couldn't understand your point. Could you clarify what you meant? Thanks.