Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752534AbcD2SJl (ORCPT ); Fri, 29 Apr 2016 14:09:41 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:36302 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436AbcD2SJj (ORCPT ); Fri, 29 Apr 2016 14:09:39 -0400 Subject: Re: [PATCH] mm: move huge_pmd_set_accessed out of huge_memory.c To: "Kirill A. Shutemov" References: <1461176698-9714-1-git-send-email-yang.shi@linaro.org> <5717EDDB.1060704@linaro.org> <20160421073050.GA32611@node.shutemov.name> <57195A87.4050408@linaro.org> <20160422094815.GB7336@node.shutemov.name> Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, aarcange@redhat.com, hughd@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linaro-kernel@lists.linaro.org From: "Shi, Yang" Message-ID: <0357941c-d7ce-3ba9-c24f-9d2599429a8a@linaro.org> Date: Fri, 29 Apr 2016 11:09:36 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160422094815.GB7336@node.shutemov.name> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1443 Lines: 45 On 4/22/2016 2:48 AM, Kirill A. Shutemov wrote: > On Thu, Apr 21, 2016 at 03:56:07PM -0700, Shi, Yang wrote: >> On 4/21/2016 12:30 AM, Kirill A. Shutemov wrote: >>> On Wed, Apr 20, 2016 at 02:00:11PM -0700, Shi, Yang wrote: >>>> Hi folks, >>>> >>>> I didn't realize pmd_* functions are protected by >>>> CONFIG_TRANSPARENT_HUGEPAGE on the most architectures before I made this >>>> change. >>>> >>>> Before I fix all the affected architectures code, I want to check if you >>>> guys think this change is worth or not? >>>> >>>> Thanks, >>>> Yang >>>> >>>> On 4/20/2016 11:24 AM, Yang Shi wrote: >>>>> huge_pmd_set_accessed is only called by __handle_mm_fault from memory.c, >>>>> move the definition to memory.c and make it static like create_huge_pmd and >>>>> wp_huge_pmd. >>>>> >>>>> Signed-off-by: Yang Shi >>> >>> On pte side we have the same functionality open-coded. Should we do the >>> same for pmd? Or change pte side the same way? >> >> Sorry, I don't quite understand you. Do you mean pte_* functions? > > See handle_pte_fault(), we do the same for pte there what > huge_pmd_set_accessed() does for pmd. Thanks for directing to this code. > > I think we should be consistent here: either both are abstructed into > functions or both open-coded. I'm supposed functions sound better. However, do_wp_page has to be called with pte lock acquired. So, the abstracted function has to call it. Thanks, Yang >