From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751692AbcCXFKT (ORCPT ); Thu, 24 Mar 2016 01:10:19 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:44574 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbcCXFKQ (ORCPT ); Thu, 24 Mar 2016 01:10:16 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Thu, 24 Mar 2016 14:11:38 +0900 From: Minchan Kim To: Gioh Kim Cc: Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, jlayton@poochiereds.net, bfields@fieldses.org, Vlastimil Babka , koct9i@gmail.com, aquini@redhat.com, virtualization@lists.linux-foundation.org, Mel Gorman , Hugh Dickins , Sergey Senozhatsky , Rik van Riel , rknize@motorola.com, Gioh Kim , Sangseok Lee , Chan Gyun Jeong , Al Viro , YiPing Xu , dri-devel@lists.freedesktop.org Subject: Re: Re: [PATCH v2 13/18] mm/compaction: support non-lru movable pagemigration Message-ID: <20160324051138.GA14101@bbox> References: <20160324052650.HM.e0000000006t8Yn@gurugio.wwl1662.hanmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160324052650.HM.e0000000006t8Yn@gurugio.wwl1662.hanmail.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 24, 2016 at 05:26:50AM +0900, Gioh Kim wrote: > Hmmm... But, in failure case, is it safe to call putback_lru_page() for > them? > And, PageIsolated() would be left. Is it okay? It's not symmetric that > isolated page can be freed by decreasing ref count without calling > putback function. This should be clarified and documented. > > I agree Joonsoo's idea. > > Freeing isolated page out of putback() could be confused. If we makes such rule, subsystem cannot free the isolated pages until VM calls putback. I don't think it's a good idea. With it, every users should make own deferred page freeing logic which might be more error-prone and obstacle for using this interface. I want to make client free his pages whenever he want if possible. > > Every detail cannot be documented. And more documents mean less elegant > code. > > Is it possible to free isolated page in putback()? > > In move_to_new_page(), can we call a_ops->migratepage like following? > > move_to_new_page() > > { > > mapping = page_mapping(page) > > if (!mapping) > > rc = migrate_page > > else if (mapping->a_ops->migratepage && IsolatePage(page)) > > rc = mapping->a_ops->migratepage > It's not a problem. The problem is that a page failed migration so VM will putback the page. But, between fail of migration and putback of isolated page, user can free the page. In this case, putback operation would be not called and pass the page in putback_lru_page. > else > > rc = fallback_migrate_page > > ... > > return rc > > } > > I'm sorry that I couldn't review in detail because I forgot many > details. You're a human being, not Alphago. :) Thanks for the review, Gioh! > > [1][Kk8NwEH1.I.q95.FfPs-qw00] > [@from=gurugio&rcpt=minchan%40kernel%2Eorg&msgid=%3C20160324052650%2EHM > %2Ee0000000006t8Yn%40gurugio%2Ewwl1662%2Ehanmail%2Enet%3E] > > References > > 1. mailto:gurugio@hanmail.net