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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 84325C3B186 for ; Thu, 13 Feb 2020 00:28:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4A618206B6 for ; Thu, 13 Feb 2020 00:28:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A618206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E75B96B04E6; Wed, 12 Feb 2020 19:28:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E262D6B04E7; Wed, 12 Feb 2020 19:28:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3BBD6B04E8; Wed, 12 Feb 2020 19:28:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id BE9EC6B04E6 for ; Wed, 12 Feb 2020 19:28:40 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8401C442C for ; Thu, 13 Feb 2020 00:28:40 +0000 (UTC) X-FDA: 76483218000.06.hill96_68c8b2c3f5d30 X-HE-Tag: hill96_68c8b2c3f5d30 X-Filterd-Recvd-Size: 3053 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 13 Feb 2020 00:28:39 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2020 16:28:38 -0800 X-IronPort-AV: E=Sophos;i="5.70,434,1574150400"; d="scan'208";a="227049991" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2020 16:28:38 -0800 Message-ID: Subject: Re: [PATCH v4 8/8] mm: support both pid and pidfd for process_madvise From: Alexander Duyck To: Minchan Kim , Andrew Morton Cc: LKML , linux-mm , linux-api@vger.kernel.org, oleksandr@redhat.com, Suren Baghdasaryan , Tim Murray , Daniel Colascione , Sandeep Patil , Sonny Rao , Brian Geffon , Michal Hocko , Johannes Weiner , Shakeel Butt , John Dias , Joel Fernandes , Christian Brauner , Kirill Tkhai Date: Wed, 12 Feb 2020 16:28:37 -0800 In-Reply-To: <20200212233946.246210-9-minchan@kernel.org> References: <20200212233946.246210-1-minchan@kernel.org> <20200212233946.246210-9-minchan@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Wed, 2020-02-12 at 15:39 -0800, Minchan Kim wrote: > There is a demand[1] to support pid as well pidfd for process_madvise > to reduce unnecessary syscall to get pidfd if the user has control of > the target process(ie, they could guarantee the process is not gone > or pid is not reused. Or, it might be okay to give a hint to wrong > process). > > This patch aims for supporting both options like waitid(2). So, the > syscall is currently, > > int process_madvise(int which, pid_t pid, void *addr, > size_t length, int advise, unsigned long flag); > > @which is actually idtype_t for userspace libray and currently, > it supports P_PID and P_PIDFD. > > [1] https://lore.kernel.org/linux-mm/9d849087-3359-c4ab-fbec-859e8186c509@virtuozzo.com/ > > Cc: Christian Brauner > Suggested-by: Kirill Tkhai > Signed-off-by: Minchan Kim So if you move patch 7 up before patch 2 you could squash this patch with your current patch 2 and drop one patch from your series. It would probably help to reduce the review overhead as well.