From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95A25C33CAF for ; Mon, 13 Jan 2020 18:44:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D350222C2 for ; Mon, 13 Jan 2020 18:44:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UmiF87Pm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D350222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 021138E0008; Mon, 13 Jan 2020 13:44:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F39098E0003; Mon, 13 Jan 2020 13:44:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E4E8A8E0008; Mon, 13 Jan 2020 13:44:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id D074C8E0003 for ; Mon, 13 Jan 2020 13:44:13 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 9E209180AD81D for ; Mon, 13 Jan 2020 18:44:13 +0000 (UTC) X-FDA: 76373485986.17.silk30_7bb7beeebd37 X-HE-Tag: silk30_7bb7beeebd37 X-Filterd-Recvd-Size: 5537 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Mon, 13 Jan 2020 18:44:12 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id 2so5263932pfg.12 for ; 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=o/WgBC7x3S4k8NVSFJcoXZEE0mJBkA+CTf2WftmlH5s5vSFqvsa0Poz/H6jNzIqlCZ 3tBA7lOIjHJUgTSZ9FgQ6zzrMCxKgnKa5YOIBD3t63CJWpmF5csDQMpJaKKd5iUECxcm /T4ibt4s98UaWZbuDU7AteHHSPxJIVKkTytHPsNQchuzM8dCqzAqYLP0LyzDXN6H8qvp boWXwtWA4v4VKyoNX6JR7ThxfV6rnLSnDnxMoGrbv8f6iCbsr0aUWWbGZojZpZdIEvG6 TuW2ZCZ9Qm9CbBeiBJX8S6fds0PbBV7DBT6+c+OYSefBfumrm2tP2aH0q9IeMDE9/Ka7 8GuQ== X-Gm-Message-State: APjAAAVHAKZUODUddKNelbCJHoxOuRVq6BsYRy4NkWKee/P5nbfXDWHF 7vndAXBns0GRCB7gtSoGxao= X-Google-Smtp-Source: APXvYqwqaUyEulapjBKHUnWFZXcRt0mFnT42KUI+pS33SC0ueuwKMg1+GGSrydffaYzLBb4Y/EMrDg== 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.