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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 76EDCC433E1 for ; Tue, 23 Jun 2020 08:59:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C44F20723 for ; Tue, 23 Jun 2020 08:59:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hPvcaNcZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C44F20723 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 98CED6B0002; Tue, 23 Jun 2020 04:59:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 93CCE6B0005; Tue, 23 Jun 2020 04:59:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8049F6B0006; Tue, 23 Jun 2020 04:59:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 5FB986B0002 for ; Tue, 23 Jun 2020 04:59:53 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0A99D8248047 for ; Tue, 23 Jun 2020 08:59:53 +0000 (UTC) X-FDA: 76959879066.21.anger06_4c03b1626e3a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id D9978180442C3 for ; Tue, 23 Jun 2020 08:59:52 +0000 (UTC) X-HE-Tag: anger06_4c03b1626e3a X-Filterd-Recvd-Size: 6466 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 23 Jun 2020 08:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592902791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6YYUHpwtKBdHN2bUzpcdFL+IBAoMpH1jVcd2VuLN6zQ=; b=hPvcaNcZgiPV6Bo6OXW2UUjHu0XRMe+mpC5qgMj2lj8hlWeuk+RAR4NMXVAA30XqduCajy INuig6z8Kwe3PEcyiW6t4Q0UemWr6Tjzk3p95Brd7nOQ07nC5w7T35DrEc9qUYbaiOjkdi wtoPXnEWtiyGKN7l0XhIWx6xjnXDppo= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-bKoz4SOdOSy3gMy-TeKbKQ-1; Tue, 23 Jun 2020 04:59:48 -0400 X-MC-Unique: bKoz4SOdOSy3gMy-TeKbKQ-1 Received: by mail-wr1-f70.google.com with SMTP id i10so10663574wrn.21 for ; Tue, 23 Jun 2020 01:59:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6YYUHpwtKBdHN2bUzpcdFL+IBAoMpH1jVcd2VuLN6zQ=; b=SoQQ1lVwwxTRrUr88Wx2Y8JbD1qshM94DU+utRdM+Jf2n5wmP8HFK+vvls/l7FJcUW yiNpr2F1MuLkbbLkgM450s720a4LikGTEYG267lZtXwvNI6I8yjcJtFWBfX7zOnzNSQ4 BOYAGmcJqOQdbqQLLHqXXaKZZF37P7HvSgL66A+BZsAFHeEDqsKhNiIPEvfOxtrmpP6j D8ONXey2kofm18ok768LewDpzRgdMiCYMZVfLSEvQQpi5iQ4jDjTus1ZNci3aZowUPpJ Qvwl29+DN2JF+gW+QmKcgKBM0YhMUlUKX1PD3ENr8kTiQVl3lm1r3CIHnZHUIYDl2yub maDQ== X-Gm-Message-State: AOAM532lxREIBpJm8ZYMQOW9wuSs3RiPHk1MDJiuHKnOLtHS5rx02UF9 /oHenKZbHzGxJQLpgl+YMW4w+fenmMyjWEGiOX2m7ARFMiFVg6aQ+VkdKrqp2EO6pAHWxNdyO6N INWHoNmM5zlQ= X-Received: by 2002:a1c:2ec7:: with SMTP id u190mr16670682wmu.48.1592902786914; Tue, 23 Jun 2020 01:59:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLrWoolrthgSu2bCq2JJvakjB4En0jFRa4H3Bx0ucd0nJhcl3Kt7z5+Ch17DeTSUScxZApyA== X-Received: by 2002:a1c:2ec7:: with SMTP id u190mr16670640wmu.48.1592902786635; Tue, 23 Jun 2020 01:59:46 -0700 (PDT) Received: from localhost ([2001:470:5b39:29:79fc:ff4e:48ab:b845]) by smtp.gmail.com with ESMTPSA id e5sm21789345wrw.19.2020.06.23.01.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 01:59:45 -0700 (PDT) Date: Tue, 23 Jun 2020 10:59:44 +0200 From: Oleksandr Natalenko To: Minchan Kim Cc: Andrew Morton , LKML , Christian Brauner , linux-mm , linux-api@vger.kernel.org, Suren Baghdasaryan , Tim Murray , Sandeep Patil , Sonny Rao , Brian Geffon , Michal Hocko , Johannes Weiner , Shakeel Butt , John Dias , Joel Fernandes , Jann Horn , alexander.h.duyck@linux.intel.com, sj38.park@gmail.com, David Rientjes , Arjun Roy Subject: Re: [PATCH v8 0/4] introduce memory hinting API for external process Message-ID: <20200623085944.cvob63vrv54fo7cs@butterfly.localdomain> References: <20200622192900.22757-1-minchan@kernel.org> <20200622193635.GA23000@google.com> MIME-Version: 1.0 In-Reply-To: <20200622193635.GA23000@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=oleksandr@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: D9978180442C3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: Hello. On Mon, Jun 22, 2020 at 12:36:35PM -0700, Minchan Kim wrote: > On Mon, Jun 22, 2020 at 12:28:56PM -0700, Minchan Kim wrote: > > Now, we have MADV_PAGEOUT and MADV_COLD as madvise hinting API. With that, > > application could give hints to kernel what memory range are preferred to be > > reclaimed. However, in some platform(e.g., Android), the information > > required to make the hinting decision is not known to the app. > > Instead, it is known to a centralized userspace daemon(e.g., ActivityManagerService), > > 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 - process_madvise(2). > > Bascially, it's same with madvise(2) syscall but it has some differences. > > > > 1. It needs pidfd of target process to provide the hint > > 2. It supports only MADV_{COLD|PAGEOUT} at this moment. > > Other hints in madvise will be opened when there are explicit requests from > > community to prevent unexpected bugs we couldn't support. > > 3. Only privileged processes can do something for other process's address > > space. > > > > For more detail of the new API, please see "mm: introduce external memory hinting API" > > description in this patchset. > > > > * from v7 - http://lore.kernel.org/r/20200302193630.68771-1-minchan@kernel.org > > * dropping pid support from new syscall and fold releated patches into syscall patch > > * dropping KSM patch by discussion - Oleksandr, I lost the discussion. > > Please resend the single patch against of the patchset if you resolves the discussion. > > https://lore.kernel.org/linux-api/20200302193630.68771-8-minchan@kernel.org/ > > Oleksandr, it seems you discussed something with Vlastimil but couldn't > find conclustion yet and Since Jann put an a new note in the thread, > I detach the patch from this patchset. > > Please send the KSM patch based on this patchset if you belive there is > no need to be actionable for comments. I don't think we came to some definite conclusion, but I'll try to implement Vlastimil's suggestion and then send it separately for evaluation. Lets keep KSM bit out of your submission so I won't slow it down. -- Best regards, Oleksandr Natalenko (post-factum) Principal Software Maintenance Engineer