Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1561058pxb; Fri, 6 Nov 2020 12:59:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXtoXZnCq/4uvQbvjS9TD+qY1Tjpbu1wCXHYnEFo/AFF28nP/USCzSDspW2e6w7+3juhES X-Received: by 2002:a05:6402:cb4:: with SMTP id cn20mr3989472edb.235.1604696387774; Fri, 06 Nov 2020 12:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604696387; cv=none; d=google.com; s=arc-20160816; b=hH88p2x1CpAezIJuNvTaJHEzb9A6A5OCdUY+tAvknJBXeMCF2CNyawdHvN2QynO3Ra Fsm+d3PzYGb8qgj9qn5Whg5JsIFQOaCb/2Tt8D1y+RLOp2FcHtthX/wsR55v7xdQKv9P Fg8RZ6sMuty06hkDa9u+tx5WB4Ifh2PsmLKoxgASFqlAlNvwykrbVp2Ab/6Xe6IWd9At a0RyUDGyp0TewWg2plOITuzwyhJTPS2aDhcrl8zc8bJCNmBYFeB57xizpOOvJyuo6Tjq ZNRCv67viKtRGDO7k7dQp/M6Kp2LV4HMtBKNtPtV0SF08IAOoYUZDlklFSqDomEAgPbX bLlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=GkUJF2wcwNFtVtDfugtak/8XayWbGhH8zDvyol5BTOw=; b=a1QHnnL+YQ25KpJ5jifT6KWSlMtmPeTWLs4Kkr+SnajjgH72D27pQw9G2bM3EQtOzg wddyWgNC3wKgMqoLyAEmeCSEicQ+klrLqK7MchmwSjSHI5bLgMGPi9xE+61olZxNINh7 RWYUMjF5+e8+n84rCay1igRtP8fKIiCPSUbhZ7lSKcI4oNOsdgSO6Ok+AlKiWjXOXYvB Gp8+r3oX/intg+xRZzaEBVzcXUx4f/rzlUh+5Reym9e5hNehNLyBf7r9mUI2uWfcfNt1 Ss+OLlKxDJry3D5E7f0oKipppMV+4qQDnXJ7o/NivkA+GO6Lrc6usItLa1j8NPLvw7fi OVQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=lbkHqjuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si1726458edj.223.2020.11.06.12.59.24; Fri, 06 Nov 2020 12:59:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=lbkHqjuG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728539AbgKFU4x (ORCPT + 99 others); Fri, 6 Nov 2020 15:56:53 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:18697 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbgKFU4w (ORCPT ); Fri, 6 Nov 2020 15:56:52 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 06 Nov 2020 12:56:56 -0800 Received: from rcampbell-dev.nvidia.com (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 6 Nov 2020 20:56:47 +0000 Subject: Re: [PATCH v3 1/6] mm/thp: add prep_transhuge_device_private_page() To: Christoph Hellwig CC: , , , , "Jerome Glisse" , John Hubbard , "Alistair Popple" , Jason Gunthorpe , Bharata B Rao , Zi Yan , "Kirill A . Shutemov" , Yang Shi , Ben Skeggs , Shuah Khan , "Andrew Morton" References: <20201106005147.20113-1-rcampbell@nvidia.com> <20201106005147.20113-2-rcampbell@nvidia.com> <20201106075554.GA31341@lst.de> From: Ralph Campbell X-Nvconfidentiality: public Message-ID: Date: Fri, 6 Nov 2020 12:56:47 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20201106075554.GA31341@lst.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604696216; bh=GkUJF2wcwNFtVtDfugtak/8XayWbGhH8zDvyol5BTOw=; h=Subject:To:CC:References:From:X-Nvconfidentiality:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=lbkHqjuGwbH6A6WGPayoyWp6kjVQqyl+1HlMHQmgnRCG7ImrV+QA3prCNDi0hcHWH 5pgzBx1Xdiu5ctXNK+U2GWo6yTLpp7AtFcK24oWgkl+tyshpzWKi3wj8nIybRWGRq2 vRu4YZvc9pShH8njactRwiAh/sEg82BOK8FELyMy+kNsdPDnon5t2NINVetSuGRljd L/lVTVqhiQ9zwL+4m/hesd8jxRBj9zubOwR/SkuakblzyCIaImrr+oUvIdccAr+kza /OQJ0ZnhXsT5Tg7g8aJFNe/0xgH5aKdy9g16stNGBndeYj4+WjornFrjd3asoPuc4z qcYOZNQNpXU9w== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/5/20 11:55 PM, Christoph Hellwig wrote: > On Thu, Nov 05, 2020 at 04:51:42PM -0800, Ralph Campbell wrote: >> +extern void prep_transhuge_device_private_page(struct page *page); > > No need for the extern. Right, I was just copying the style. Would you like to see a preparatory patch that removes extern for the other declarations in huge_mm.h? >> +static inline void prep_transhuge_device_private_page(struct page *page) >> +{ >> +} > > Is the code to call this even reachable if THP support is configured > out? If not just declaring it unconditionally and letting dead code > elimination do its job might be a tad cleaner. The HMM test driver depends on TRANSPARENT_HUGEPAGE but the nouveau SVM option doesn't and SVM is still useful if TRANSPARENT_HUGEPAGE is not configured. The problem with defining prep_transhuge_device_private_page() in huge_mm.h as a static inline function is that prep_compound_page() and prep_transhuge_page() would have to be EXPORT_SYMBOL_GPL which are currently mm internal only. The intent is to make this helper callable by separate device driver modules using struct pages created with memremap_pages(). >> +void prep_transhuge_device_private_page(struct page *page) > > I think a kerneldoc comment explaining what this function is useful for > would be helpful. That is a good idea. I'll add it to v4.