Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932283AbcCRJkc (ORCPT ); Fri, 18 Mar 2016 05:40:32 -0400 Received: from e19.ny.us.ibm.com ([129.33.205.209]:54837 "EHLO e19.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754041AbcCRJkU (ORCPT ); Fri, 18 Mar 2016 05:40:20 -0400 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: aneesh.kumar@linux.vnet.ibm.com X-IBM-RcptTo: linux-fsdevel@vger.kernel.org;linux-kernel@vger.kernel.org From: "Aneesh Kumar K.V" To: "Kirill A. Shutemov" , Hugh Dickins , Andrea Arcangeli , Andrew Morton Cc: Dave Hansen , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Jerome Marchand , Yang Shi , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Kirill A. Shutemov" Subject: Re: [PATCHv4 04/25] rmap: support file thp In-Reply-To: <1457737157-38573-5-git-send-email-kirill.shutemov@linux.intel.com> References: <1457737157-38573-1-git-send-email-kirill.shutemov@linux.intel.com> <1457737157-38573-5-git-send-email-kirill.shutemov@linux.intel.com> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 18 Mar 2016 15:10:06 +0530 Message-ID: <87d1qs9lah.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16031809-0057-0000-0000-000003CD024D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 738 Lines: 20 "Kirill A. Shutemov" writes: > [ text/plain ] > Naive approach: on mapping/unmapping the page as compound we update > ->_mapcount on each 4k page. That's not efficient, but it's not obvious > how we can optimize this. We can look into optimization later. > > PG_double_map optimization doesn't work for file pages since lifecycle > of file pages is different comparing to anon pages: file page can be > mapped again at any time. > Can you explain this more ?. We added PG_double_map so that we can keep page_remove_rmap simpler. So if it isn't a compound page we still can do if (!atomic_add_negative(-1, &page->_mapcount)) I am trying to understand why we can't use that with file pages ? -aneesh