From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756971AbcEEJyB (ORCPT ); Thu, 5 May 2016 05:54:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:40467 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756401AbcEEJyA (ORCPT ); Thu, 5 May 2016 05:54:00 -0400 Date: Thu, 5 May 2016 10:53:56 +0100 From: Mel Gorman To: jglisse@redhat.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , Andrea Arcangeli Subject: Re: [PATCH] mm/numa/thp: fix assumptions of migrate_misplaced_transhuge_page() Message-ID: <20160505095356.GD2765@suse.de> References: <1462278831-1959-1-git-send-email-jglisse@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1462278831-1959-1-git-send-email-jglisse@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 03, 2016 at 02:33:51PM +0200, jglisse@redhat.com wrote: > From: Jérôme Glisse > > Fix assumptions in migrate_misplaced_transhuge_page() which is only > call by do_huge_pmd_numa_page() itself only call by __handle_mm_fault() > for pmd with PROT_NONE. This means that if the pmd stays the same > then there can be no concurrent get_user_pages / get_user_pages_fast > (GUP/GUP_fast). More over because migrate_misplaced_transhuge_page() > abort if page is mapped more than once then there can be no GUP from > a different process. Finaly, holding the pmd lock assure us that no > other part of the kernel can take an extra reference on the page. > > In the end this means that the failure code path should never be > taken unless something is horribly wrong, so convert it to BUG_ON(). > > Signed-off-by: Jérôme Glisse > Acked-by: Kirill A. Shutemov > Cc: Mel Gorman > Cc: Hugh Dickins > Cc: Andrea Arcangeli Acked-by: Mel Gorman -- Mel Gorman SUSE Labs