From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751407AbdCXLXT (ORCPT ); Fri, 24 Mar 2017 07:23:19 -0400 Received: from foss.arm.com ([217.140.101.70]:39338 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdCXLXL (ORCPT ); Fri, 24 Mar 2017 07:23:11 -0400 From: Punit Agrawal To: "Kirill A. Shutemov" Cc: Mike Kravetz , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Catalin Marinas , Andrew Morton , "Kirill A. Shutemov" , Tyler Baicar Subject: Re: [RFC PATCH 0/2] Add hstate parameter to huge_pte_offset() References: <20170323125823.429-1-punit.agrawal@arm.com> <20170324103709.253qw6pyjaq5wrgb@node.shutemov.name> Date: Fri, 24 Mar 2017 11:23:08 +0000 In-Reply-To: <20170324103709.253qw6pyjaq5wrgb@node.shutemov.name> (Kirill A. Shutemov's message of "Fri, 24 Mar 2017 13:37:09 +0300") Message-ID: <87efxmhqar.fsf@e105922-lin.cambridge.arm.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: > On Thu, Mar 23, 2017 at 01:55:27PM -0700, Mike Kravetz wrote: >> On 03/23/2017 05:58 AM, Punit Agrawal wrote: >> > On architectures that support hugepages composed of contiguous pte as >> > well as block entries at the same level in the page table, >> > huge_pte_offset() is not able to determine the right offset to return >> > when it encounters a swap entry (which is used to mark poisoned as >> > well as migrated pages in the page table). >> > >> > huge_pte_offset() needs to know the size of the hugepage at the >> > requested address to determine the offset to return - the current >> > entry or the first entry of a set of contiguous hugepages. This came >> > up while enabling support for memory failure handling on arm64[0]. >> > >> > Patch 1 adds a hstate parameter to huge_pte_offset() to provide >> > additional information about the target address. It also updates the >> > signatures (and usage) of huge_pte_offset() for architectures that >> > override the generic implementation. This patch has been compile >> > tested on ia64 and x86. >> >> I haven't looked at the performance implications of making huge_pte_offset >> just a little slower. But, I think you can get hstate from the parameters >> passed today. >> >> vma = find_vma(mm, addr); >> h = hstate_vma(vma); > > It's better to avoid find_vma() in fast(?) path if possible. So passing it > down is probably better. Also most call sites of huge_pte_offset() already have the hstate (or the vma) readily available. So adding overhead feels unnecessary. I agree that merging the patch will need some co-ordination but lets at the least give it a shot.