Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756954AbdCHGmV (ORCPT ); Wed, 8 Mar 2017 01:42:21 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:55970 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756752AbdCHGl4 (ORCPT ); Wed, 8 Mar 2017 01:41:56 -0500 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 165.244.249.26 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Wed, 8 Mar 2017 15:41:47 +0900 From: Minchan Kim To: "Kirill A. Shutemov" CC: Andrew Morton , , , , Johannes Weiner , Michal Hocko , Vlastimil Babka , "Kirill A . Shutemov" Subject: Re: [RFC 05/11] mm: make the try_to_munlock void function Message-ID: <20170308064147.GG11206@bbox> References: <1488436765-32350-1-git-send-email-minchan@kernel.org> <1488436765-32350-6-git-send-email-minchan@kernel.org> <20170307151747.GA2940@node.shutemov.name> MIME-Version: 1.0 In-Reply-To: <20170307151747.GA2940@node.shutemov.name> User-Agent: Mutt/1.5.24 (2015-08-30) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/08 15:41:47, Serialize by Router on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/08 15:41:47, Serialize complete at 2017/03/08 15:41:47 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 40 On Tue, Mar 07, 2017 at 06:17:47PM +0300, Kirill A. Shutemov wrote: > On Thu, Mar 02, 2017 at 03:39:19PM +0900, Minchan Kim wrote: > > try_to_munlock returns SWAP_MLOCK if the one of VMAs mapped > > the page has VM_LOCKED flag. In that time, VM set PG_mlocked to > > the page if the page is not pte-mapped THP which cannot be > > mlocked, either. > > > > With that, __munlock_isolated_page can use PageMlocked to check > > whether try_to_munlock is successful or not without relying on > > try_to_munlock's retval. It helps to make ttu/ttuo simple with > > upcoming patches. > > I *think* you're correct, but it took time to wrap my head around. > We basically rely on try_to_munlock() never caller for PTE-mapped THP. > And we don't at the moment. > > It worth adding something like > > VM_BUG_ON_PAGE(PageCompound(page) && PageDoubleMap(page), page); > > into try_to_munlock(). Agree. > > Otherwise looks good to me. > > Will free adding my Acked-by once this nit is addressed. Thanks for the review this part, Kirill! > > -- > Kirill A. Shutemov > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org