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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FSL_HELO_FAKE,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 E517BC1975A for ; Thu, 12 Mar 2020 20:23:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A2E9E206E2 for ; Thu, 12 Mar 2020 20:23:44 +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="uHQkP5ZY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2E9E206E2 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 4D6226B0005; Thu, 12 Mar 2020 16:23:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 486EF6B0006; Thu, 12 Mar 2020 16:23:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 375616B0007; Thu, 12 Mar 2020 16:23:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 1D82A6B0005 for ; Thu, 12 Mar 2020 16:23:44 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DF42B127B9 for ; Thu, 12 Mar 2020 20:23:43 +0000 (UTC) X-FDA: 76587835926.21.verse79_5aac194715660 X-HE-Tag: verse79_5aac194715660 X-Filterd-Recvd-Size: 5780 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Mar 2020 20:23:42 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id d8so3115344pje.4 for ; Thu, 12 Mar 2020 13:23:42 -0700 (PDT) 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=E48tDkZx/8j+Ju5P8a7Hgys5ARHNcg71wMnlvvHjODQ=; b=uHQkP5ZYmW2TWq+I/J0FK+bJgD+cfoL9CWjoXUTPJWUbEFmEn0h6lO4cHmDaf1qhOo 2PI0epZ4LwmiF2rffZXulhUT4LkIHxSSYzhhNWUc+hpluTp/nZ7hXMV3+hRv0clx24+Q QplHZeHr/unYjngauEgMJ5xqSoSCudiNDBcOsacdYIptVpwaww7rXA6jXldbWLKnfEJh weR/DI+v7Rq9dJ9ESGWe0vjLLCZhsjXS4eq2odTI4NB+1PFBClj/5JOOIlyx37WuZHWD WdZG6jUmlH6j1GW5PdaeoElUo1oZEL15dkV6psfnXPjCGCHGFY+sQJ8fVwacyem2dzMY zLig== 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=E48tDkZx/8j+Ju5P8a7Hgys5ARHNcg71wMnlvvHjODQ=; b=bYyrYfNasO+6wvQx+n6kKBmJdxN0DM+OrdXpAFY+PHTvL8XG26C6rHNWSSYhTamfXk GmCtkdIHituUrR6jQVIqLq4JqmUXepqkc0y/4vaTyIXzy8gdWD5pgmWPIivrx0atxxjH lfMgdvtihff1EikcGOB/SoLSuUsrYjvoc58ITohkURrD2BDB0cNNrMenT9RXoC+CvY2Y nK+fqFbiJgntItGjlerAyGWrH3H2A3r8hB9AUVyHfON9X0y2Zuk1j9xH/Jm69rG+xrG0 rsI1wyY1YVN7KbX0JiZG16adt3TdYJQzOw/KhLV+8dVKQ08PlsSiZy1ffRpyYMEyZrtj rD7g== X-Gm-Message-State: ANhLgQ0qp3p1Y3VWP1o8YZREo0IuZZ+bRJNGSL1LaWHEiM3XymLc945/ Ss0HQpQypaPhdXgg2SInJtQ= X-Google-Smtp-Source: ADFU+vtfHouS/icEFZlgwFly1nG+Y9MAhxq009zIbS2uW0Cb2Uz9i1mtCzAK4DHsvIMnFvMmjPeKhg== X-Received: by 2002:a17:902:bc4c:: with SMTP id t12mr9032471plz.54.1584044621809; Thu, 12 Mar 2020 13:23:41 -0700 (PDT) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id z17sm7602271pff.12.2020.03.12.13.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 13:23:40 -0700 (PDT) Date: Thu, 12 Mar 2020 13:23:39 -0700 From: Minchan Kim To: Vlastimil Babka Cc: 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 , Michal Hocko , Johannes Weiner , Shakeel Butt , John Dias , Joel Fernandes , Jann Horn , alexander.h.duyck@linux.intel.com, sj38.park@gmail.com Subject: Re: [PATCH v7 2/7] mm: introduce external memory hinting API Message-ID: <20200312202339.GB68817@google.com> References: <20200302193630.68771-1-minchan@kernel.org> <20200302193630.68771-3-minchan@kernel.org> <20200310222008.GB72963@google.com> <07109fb3-dcf3-0252-4515-7e476fadc259@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07109fb3-dcf3-0252-4515-7e476fadc259@suse.cz> User-Agent: Mutt/1.12.2 (2019-09-21) 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 Thu, Mar 12, 2020 at 01:40:26PM +0100, Vlastimil Babka wrote: > On 3/10/20 11:20 PM, Minchan Kim wrote: > > On Thu, Mar 05, 2020 at 07:15:10PM +0100, Vlastimil Babka wrote: > >> On 3/2/20 8:36 PM, Minchan Kim wrote: > >> > There is usecase that System Management Software(SMS) want to give > >> > a memory hint like MADV_[COLD|PAGEEOUT] to other processes and > >> > in the case of Android, it is the ActivityManagerService. > >> > > >> > It's similar in spirit to madvise(MADV_WONTNEED), but the information > >> > >> You mean MADV_DONTNEED? > > > > Mean to DONT_NEED's future version. > > What's that exactly? For zapping timing point of view, dontneed acts immediately so it's very strong hint. However, MADV_COLD and MADV_PAGEOUT does lazily depending on the future. For example, the page never discarded if it's touched before the tail of LRU. If other process which shared the page has touched the page, never paging out. > > >> > >> > required to make the reclaim decision is not known to the app. > >> > >> This seems to be mixing up the differences between MADV_DONTNEED and > >> COLD/PAGEOUT and self-imposed vs external memory hints? > > > > Sorry, I don't understand what you want here. > > You say that process_madvise(MADV_[COLD|PAGEEOUT]) is similar to > madvise(MADV_WONTNEED) but the difference is that the information > required to make the reclaim decision is not known to the app. > > I see two differences. One is madvise vs process_madvise, which is explained by > "reclaim decision is not known to the app." > The other is MADV_WONTNEED vs MADV_[COLD|PAGEEOUT], which is... I'm not sure > until you say what's "DONT_NEED's future version" :D > > Anyway I assume this part is from the versions where the new COLD and PAGEOUT > flags were introduced together with external memory hinting API? Exactly. Maybe it would be better to remove the part once we merged the COLD and PAGEOUT now. Thanks for the review, Vlastimil!