From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753789AbbCaVfa (ORCPT ); Tue, 31 Mar 2015 17:35:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54309 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753670AbbCaVf1 (ORCPT ); Tue, 31 Mar 2015 17:35:27 -0400 Date: Tue, 31 Mar 2015 14:35:21 -0700 From: Andrew Morton To: Naoya Horiguchi Cc: Mel Gorman , Naoya Horiguchi , "linux-mm@kvack.org" , Hugh Dickins , "Kirill A. Shutemov" , "David Rientjes" , Rik van Riel , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mm: numa: disable change protection for vma(VM_HUGETLB) Message-Id: <20150331143521.652d655e396d961410179d4d@linux-foundation.org> In-Reply-To: <20150331014554.GA8128@hori1.linux.bs1.fc.nec.co.jp> References: <1427708426-31610-1-git-send-email-n-horiguchi@ah.jp.nec.com> <20150330102802.GQ4701@suse.de> <55192885.5010608@gmail.com> <20150330115901.GR4701@suse.de> <20150331014554.GA8128@hori1.linux.bs1.fc.nec.co.jp> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Mar 2015 01:45:55 +0000 Naoya Horiguchi wrote: > Currently when a process accesses to hugetlb range protected with PROTNONE, > unexpected COWs are triggered, which finally put hugetlb subsystem into > broken/uncontrollable state, where for example h->resv_huge_pages is subtracted > too much and wrapped around to a very large number, and free hugepage pool > is no longer maintainable. > > This patch simply stops changing protection for vma(VM_HUGETLB) to fix the > problem. And this also allows us to avoid useless overhead of minor faults. > > ... > > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -2161,8 +2161,10 @@ void task_numa_work(struct callback_head *work) > vma = mm->mmap; > } > for (; vma; vma = vma->vm_next) { > - if (!vma_migratable(vma) || !vma_policy_mof(vma)) > + if (!vma_migratable(vma) || !vma_policy_mof(vma) || > + is_vm_hugetlb_page(vma)) { > continue; > + } > > /* > * Shared library pages mapped by multiple processes are not Which kernel version(s) need this patch?