Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp998509ybi; Fri, 12 Jul 2019 08:02:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP7RQsFnXAxb91zTQrdCxTKWb6+uOvEDNU48EO72h+YIwqA/YMUcQm84ADGR1ha0apmwUw X-Received: by 2002:a17:902:106:: with SMTP id 6mr12278522plb.64.1562943748328; Fri, 12 Jul 2019 08:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562943748; cv=none; d=google.com; s=arc-20160816; b=Kau9ZYW+q7rqcXc1/6QOIklLKC4msDdrq95S3jrDYNGO5q1xtyApJQuNOQUl+wftR5 4PkkUum/fe0Of2m9b3zvrhmEoXfXCfRcXHCV9Vk3HJeIGIWSezJeZep+V/W7XuXPRjQr Sj+pHH7y9slp9+Iwih38LMdZMXFnjCb534bx1Qcb4GDlttwiybHVtK//tzUAEzUI00BX wPKigsB3WhWdwa8iNRsFINVtjtlHFyzJ7U0ZuP9ImcfyM+7cP4YdVB6rlSKcAffyBchp C2x7T2d6uCUKMiy5QpX7307X17KqTkVZhdErk9HLLXzldnlFBmZslazEOYTrlzm/UppJ wZDw== 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; bh=D1mDCghNHFZf9mSlYR0mupbNP94KV/aTZJZt10WBa9U=; b=pi3cpsWI6Z/YsyjpM2+aMB43GFT0rZ2DoY+uh/bDv9CzqXPTc8f5RVIToLmqst0HK1 R11CKYWb3aOl/YAryrCZ79W4nVhX2lL78MAL/hOu5uy9vb40E5E/65qm/mAM4STrF4pB Nqp7OJgl/3Xh6F/xJqDiKzI3A1Asm0m4Q5fv2cDvEf8YyqTrV4avWJ+moL6zhHimP6pu 2u6nAiDWCKpjaHGXDw5lmbfxJveLKuRQyIAvRqjbNu+fv2HVC2b6lYYgX5SXmouruZZC ViDopHGkly8vvWo0FI+RcPZ5/ZaPSZh1882553AOoB6VHRJdLnpuL2wFLxBnsti+LB/Q 3UVg== ARC-Authentication-Results: i=1; mx.google.com; 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 g17si7724779plo.406.2019.07.12.08.02.11; Fri, 12 Jul 2019 08:02:28 -0700 (PDT) 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; 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 S1727177AbfGLPBa (ORCPT + 99 others); Fri, 12 Jul 2019 11:01:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:50734 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726724AbfGLPBa (ORCPT ); Fri, 12 Jul 2019 11:01:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CC43AAE84; Fri, 12 Jul 2019 15:01:28 +0000 (UTC) Date: Fri, 12 Jul 2019 17:01:27 +0200 From: Michal Hocko To: Johannes Weiner Cc: Minchan Kim , Andrew Morton , linux-mm , LKML , linux-api@vger.kernel.org, Tim Murray , Joel Fernandes , Suren Baghdasaryan , Daniel Colascione , Shakeel Butt , Sonny Rao , oleksandr@redhat.com, hdanton@sina.com, lizeb@google.com, Dave Hansen , "Kirill A . Shutemov" Subject: Re: [PATCH v4 4/4] mm: introduce MADV_PAGEOUT Message-ID: <20190712150127.GV29483@dhcp22.suse.cz> References: <20190711012528.176050-1-minchan@kernel.org> <20190711012528.176050-5-minchan@kernel.org> <20190711184223.GD20341@cmpxchg.org> <20190712051828.GA128252@google.com> <20190712135809.GB31107@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190712135809.GB31107@cmpxchg.org> 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 Fri 12-07-19 09:58:09, Johannes Weiner wrote: [...] > > @@ -423,6 +445,12 @@ static int madvise_cold_pte_range(pmd_t *pmd, unsigned long addr, > > > > VM_BUG_ON_PAGE(PageTransCompound(page), page); > > > > + if (pageout) { > > + if (isolate_lru_page(page)) > > + continue; > > + list_add(&page->lru, &page_list); > > + } > > + > > if (pte_young(ptent)) { > > ptent = ptep_get_and_clear_full(mm, addr, pte, > > tlb->fullmm); > > One thought on the ordering here. > > When LRU isolation fails, it would still make sense to clear the young > bit: we cannot reclaim the page as we wanted to, but the user still > provided a clear hint that the page is cold and she won't be touching > it for a while. MADV_PAGEOUT is basically MADV_COLD + try_to_reclaim. > So IMO isolation should go to the end next to deactivate_page(). Make sense to me -- Michal Hocko SUSE Labs