Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753549AbaAQUe5 (ORCPT ); Fri, 17 Jan 2014 15:34:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbaAQUey (ORCPT ); Fri, 17 Jan 2014 15:34:54 -0500 Date: Fri, 17 Jan 2014 21:34:44 +0100 From: Oleg Nesterov To: Alex Thorlton Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Andrew Morton , "Kirill A. Shutemov" , Benjamin Herrenschmidt , Rik van Riel , Naoya Horiguchi , "Eric W. Biederman" , Andy Lutomirski , Al Viro , Kees Cook , Andrea Arcangeli Subject: Re: [RFC PATCHv2 2/2] Change khugepaged to respect MMF_THP_DISABLE flag Message-ID: <20140117203444.GA16396@redhat.com> References: <1bc8f911363af956b37d8ea415d734f3191f1c78.1389905087.git.athorlton@sgi.com> <13c9d1b0213af7cee7afb54de368a0b189e98df8.1389905087.git.athorlton@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13c9d1b0213af7cee7afb54de368a0b189e98df8.1389905087.git.athorlton@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/16, Alex Thorlton wrote: > > static inline int khugepaged_test_exit(struct mm_struct *mm) > { > - return atomic_read(&mm->mm_users) == 0; > + return atomic_read(&mm->mm_users) == 0 || > + (mm->flags & MMF_THP_DISABLE_MASK); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ test_bit(MMF_THP_DISABLE) ? And I am not sure this and another check in transparent_hugepage_enabled is actually right... I think that MMF_THP_DISABLE_MASK should not disable thp if this vma has VM_HUGEPAGE set, iow perhaps madvise() should work even after PR_SET_THP_DISABLE? IOW, MMF_THP_DISABLE should act as khugepaged_req_madv(). But again, I won't argue. Oleg. -- 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/