Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbbGJAVv (ORCPT ); Thu, 9 Jul 2015 20:21:51 -0400 Received: from lgeamrelo01.lge.com ([156.147.1.125]:60829 "EHLO lgeamrelo01.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346AbbGJAVn (ORCPT ); Thu, 9 Jul 2015 20:21:43 -0400 X-Original-SENDERIP: 10.178.37.108 X-Original-MAILFROM: gioh.kim@lge.com Message-ID: <559F1014.6070306@lge.com> Date: Fri, 10 Jul 2015 09:21:40 +0900 From: Gioh Kim User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Michael S. Tsirkin" , koct9i@gmail.com, aquini@redhat.com CC: jlayton@poochiereds.net, bfields@fieldses.org, vbabka@suse.cz, iamjoonsoo.kim@lge.com, viro@zeniv.linux.org.uk, minchan@kernel.org, linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, gunho.lee@lge.com, akpm@linux-foundation.org, Gioh Kim Subject: Re: [RFCv3 3/5] mm/balloon: apply mobile page migratable into balloon References: <1436243785-24105-1-git-send-email-gioh.kim@lge.com> <1436243785-24105-4-git-send-email-gioh.kim@lge.com> <20150709105119-mutt-send-email-mst@redhat.com> In-Reply-To: <20150709105119-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1326 Lines: 39 >> @@ -124,6 +130,7 @@ static inline void balloon_page_insert(struct balloon_dev_info *balloon, >> struct page *page) >> { >> __SetPageBalloon(page); >> + page->mapping = balloon->inode->i_mapping; >> SetPagePrivate(page); >> set_page_private(page, (unsigned long)balloon); >> list_add(&page->lru, &balloon->pages); >> @@ -140,6 +147,7 @@ static inline void balloon_page_insert(struct balloon_dev_info *balloon, >> static inline void balloon_page_delete(struct page *page) >> { >> __ClearPageBalloon(page); >> + page->mapping = NULL; >> set_page_private(page, 0); >> if (PagePrivate(page)) { >> ClearPagePrivate(page); > > Order of cleanup here is not the reverse of the order of initialization. > Better make it exactly the reverse. > > > Also, I have a question: is it enough to lock the page to make changing > the mapping safe? Do all users lock the page too? > > > > I think balloon developers can answer that precisely. I've just follow this comment: http://lxr.free-electrons.com/source/include/linux/balloon_compaction.h#L16 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/