From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by kanga.kvack.org (Postfix) with ESMTP id 8EB7D6B0009 for ; Thu, 11 Feb 2016 13:52:11 -0500 (EST) Received: by mail-pf0-f182.google.com with SMTP id c10so34158762pfc.2 for ; Thu, 11 Feb 2016 10:52:11 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com. [134.134.136.65]) by mx.google.com with ESMTP id l84si14117856pfb.158.2016.02.11.10.52.10 for ; Thu, 11 Feb 2016 10:52:10 -0800 (PST) From: Andi Kleen Subject: Re: [PATCHv2 02/28] rmap: introduce rmap_walk_locked() References: <1455200516-132137-1-git-send-email-kirill.shutemov@linux.intel.com> <1455200516-132137-3-git-send-email-kirill.shutemov@linux.intel.com> Date: Thu, 11 Feb 2016 10:52:08 -0800 In-Reply-To: <1455200516-132137-3-git-send-email-kirill.shutemov@linux.intel.com> (Kirill A. Shutemov's message of "Thu, 11 Feb 2016 17:21:30 +0300") Message-ID: <87y4ardqqv.fsf@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Hugh Dickins , Andrea Arcangeli , Andrew Morton , Dave Hansen , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Jerome Marchand , Yang Shi , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org "Kirill A. Shutemov" writes: > rmap_walk_locked() is the same as rmap_walk(), but caller takes care > about relevant rmap lock. > > It's preparation to switch THP splitting from custom rmap walk in > freeze_page()/unfreeze_page() to generic one. Would be better to move all locking into the callers, with an appropiate helper for users who don't want to deal with it. Conditional locking based on flags is always tricky. -Andi -- ak@linux.intel.com -- Speaking for myself only -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751964AbcBKSwM (ORCPT ); Thu, 11 Feb 2016 13:52:12 -0500 Received: from mga02.intel.com ([134.134.136.20]:43012 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751493AbcBKSwJ (ORCPT ); Thu, 11 Feb 2016 13:52:09 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,432,1449561600"; d="scan'208";a="650817230" From: Andi Kleen To: "Kirill A. Shutemov" Cc: Hugh Dickins , Andrea Arcangeli , Andrew Morton , Dave Hansen , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Jerome Marchand , Yang Shi , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv2 02/28] rmap: introduce rmap_walk_locked() References: <1455200516-132137-1-git-send-email-kirill.shutemov@linux.intel.com> <1455200516-132137-3-git-send-email-kirill.shutemov@linux.intel.com> Date: Thu, 11 Feb 2016 10:52:08 -0800 In-Reply-To: <1455200516-132137-3-git-send-email-kirill.shutemov@linux.intel.com> (Kirill A. Shutemov's message of "Thu, 11 Feb 2016 17:21:30 +0300") Message-ID: <87y4ardqqv.fsf@tassilo.jf.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Kirill A. Shutemov" writes: > rmap_walk_locked() is the same as rmap_walk(), but caller takes care > about relevant rmap lock. > > It's preparation to switch THP splitting from custom rmap walk in > freeze_page()/unfreeze_page() to generic one. Would be better to move all locking into the callers, with an appropiate helper for users who don't want to deal with it. Conditional locking based on flags is always tricky. -Andi -- ak@linux.intel.com -- Speaking for myself only