From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753793Ab2I0BkK (ORCPT ); Wed, 26 Sep 2012 21:40:10 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:38066 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753600Ab2I0BkH (ORCPT ); Wed, 26 Sep 2012 21:40:07 -0400 Date: Wed, 26 Sep 2012 18:40:04 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Hugh Dickins , Andrew Morton cc: Linus Torvalds , Andrea Arcangeli , Naoya Horiguchi , KAMEZAWA Hiroyuki , Johannes Weiner , Michel Lespinasse , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org Subject: Re: [patch for-3.6] mm, thp: fix mapped pages avoiding unevictable list on mlock In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Sep 2012, Hugh Dickins wrote: > Good catch, and the patch looks right to me, as far as it goes: > but does it go far enough? > > I hesitate because it looks as if the NR_MLOCK zone page state is > maintained (with incs and decs) in ignorance of THP; so although > you will be correcting the Unevictable kB with your mlock_vma_page(), > the Mlocked kB just above it in /proc/meminfo would still be wrong? > Indeed, NR_MLOCK is a separate problem with regard to thp and it's currently incremented once for every hugepage rather than HPAGE_PMD_NR. mlock_vma_page() needs to increment by hpage_nr_pages(page) like add_page_to_lru_list() does. > I suppose I'm not sure whether this is material for late-3.6: > surely it's not a fix for a recent regression? > Ok, sounds good. If there's no objection, I'd like to ask Andrew to apply this to -mm and remove the cc to stable@vger.kernel.org since the mlock_vma_page() problem above is separate and doesn't conflict with this code, so I'll send a followup patch to address that. Thanks!