Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp764475lqp; Thu, 21 Mar 2024 15:08:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFNBL/Eb5xsyaBjr7c8pAhAiPVjRAXYzEOQpPa2rAZKMCZa0k6kQ9lAbqnEtfruMH03yXGqPQo0nD+ofqS77Yd35E2pkD7VPeTtuf3ZA== X-Google-Smtp-Source: AGHT+IGyG8n49FmH+5YMTsC5xXnUyGCqX9qD/YDkhp6dgFMsvR8tZ/sk2S8UObGCn8AXwHNP2R80 X-Received: by 2002:a05:6870:7196:b0:221:9ab1:7629 with SMTP id d22-20020a056870719600b002219ab17629mr598014oah.7.1711058926200; Thu, 21 Mar 2024 15:08:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711058926; cv=pass; d=google.com; s=arc-20160816; b=sSpWXi3e/iTIyRMwCblOoapNxm7o/77u+GFzbraCoLYtjGoeDrnXsrGfQ6/ImJwgyg i4A1UWOLKMkkVFNJWPqPE58MAakfPnKfe4A0X5griKD170EGU5U7Dct4wDh9gUrVW8v8 fOSBNFd5iRLn60ZGNeWGYKUHhkYdnMskDyhHjs636XuFh9c1xa9xCv+k5iXIbosTv7VH 5rPcoaMwH9v9nrGt6vA5j3BhhVUP4J5OCiAnWBaDz/HLFDk/CkdsRXiBobGC5m3gQ11W X/C650Nue9mkQ8PFzAVeVA76Nylm9RIQ1dczQLVsoKoi4yvAQBT2/2hx057r5lG88rcE dMqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Jz9rMLZ3uXx9gi3+G5qYwalRYpIGEA6fjYlj3iYlq7A=; fh=JCZ8qTiJT3H6THV39QEv2kNJ2cfu9XFAMTTaT4BT6TU=; b=gTeLwtZI1E2FCU6eofwVEPda72kbDiqftEs+T0+tLJVwUrBXzym3QtHRMw6F+uscED uTt5axZIx5fpTltVn/t+OUlQbsM4e7hj9wvsPnp4bjUXjqqn/lwIVKwxZIyWlWqBTqmL TQyrLiInlvmlA2FGaHrJoatFoFebWCLRLM9YGNDQPc0M/TCOZEvLzqt3wnu+5l2Qtfmw GyjBJMxH07KwEVL4jW7iBOW1zkrz+LLvI8jCTnmKR7sDLzqv725F/iaKCHWb89X5TWYv zudz7tGaFZTz6J30QOrUGok7hNoM7XR8rIy+KsYTre4BG8k2icTMYMBRnQ0cd2A3zTbw yDRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KmqDaG3Q; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-110728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wh15-20020a05620a56cf00b007887d6a5044si663972qkn.277.2024.03.21.15.08.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 15:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KmqDaG3Q; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-110728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D92E91C20A15 for ; Thu, 21 Mar 2024 22:08:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FD381369B9; Thu, 21 Mar 2024 22:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KmqDaG3Q" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 905C913698D for ; Thu, 21 Mar 2024 22:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711058895; cv=none; b=DljqkKUShiT5Ml56sREk8+SIKWxD41+17AO4tgI7JSvyvllufOuNvrrQkIfUBGIgB+VeVqN/lFsYZe769g+d+HwzmsVGaWmKrK6n2by+CyXJGW31fdTiCzmH5YE9tS6fr9x/xR8NbsIPFw0PBVl+FJPuUNiEC322JBYh0GMTA3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711058895; c=relaxed/simple; bh=+4tZFXGWGkSnTz93a1WxUt5Jp3XdX9cL1+SLoKZJKc0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c80mW/P5WJS3Wpq/F8Ksurlxriy9S9XGWsqSvMxj9YW9Iw2UsSsQROAKOEKo3bE3g/WLgRB2HpVpc3wfo7M2uafRslP0xXvOKZcOHqn77oakzNp0BMEWCpYAQPE5NlUQm/mgWmoxowk0V1QNOe68rkvHpl0Pp1mpD+seL8zGG+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=KmqDaG3Q; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711058892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jz9rMLZ3uXx9gi3+G5qYwalRYpIGEA6fjYlj3iYlq7A=; b=KmqDaG3QJeibo6THK7uh9vMDJPbTPl9oAJVqUC1c0NNTrBsq7k+odxG/an31Kp+ZvKtRsh vYleRoMOOsdESN2dPgVXHUoTBqOwykMr+3gvuL46b6XxQdqCXpqB38aVYaSkCV8uJ0EXHE gkno7CQVHfTPM+0O6DuMhec4KjOuhu0= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-L_DSMoqsNk2TWtPgRTkENg-1; Thu, 21 Mar 2024 18:08:10 -0400 X-MC-Unique: L_DSMoqsNk2TWtPgRTkENg-1 Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-4769277a5fbso157091137.1 for ; Thu, 21 Mar 2024 15:08:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711058889; x=1711663689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jz9rMLZ3uXx9gi3+G5qYwalRYpIGEA6fjYlj3iYlq7A=; b=hVvUlf0nz12zSS1bjFWic2G+CU0YdJ/9nQcHR1M5oVSa4TeyQKH1izkRRF5JaxJ9he IFwiEwCRWJPH8HiMf2kjiUZQkqrauUb95XsMvxzb1mFSy0irVwEN4X8aPyK73TEP+tOR k9firVsnsg8kUU2+VFWRSd3X/K8tJlJuObEIzskfh9kDQLhshQSUEJvWizadwCmt3skb LQ/VkPOAhKaqlu5Olak/iAaHZOX24ilehSI675C3jsTHc9F9pQfRNsUJuw1ZEFsgTCMN juUkKCZoviEOMTt5T7ZyQvcsInfD3AJE5/ao9sFEi4AynNcSbuYLMk3OTOECxS+sRtnv hcAA== X-Forwarded-Encrypted: i=1; AJvYcCV3PdcQU9pZyeR07MZV3ML6fSm8LzKzUZm6wKkt0YWEnBHrNZxTwlw9insC7qgms2YnUFqJz3Nd+c6yn/XQ07nvmW1y5pPZBnNaVcfF X-Gm-Message-State: AOJu0Ywnfw9/ADsNCPvfghDGkjNBJbmEUw/Np45iCO/C/dT47fAPTy68 HGcWiVHSeVus/QhCxMPW7qtx/GVg352E4TwP6DnN/QBV4RYYXkluVaWNlJsbz/LuvIf++6f9hPN wBRUtnwiG9WtGEfLQBU4ISdQXkp3dJXTyz2N7xOe4AIrEpZ3iIEyfDXzrXongEA== X-Received: by 2002:a05:6122:6b2:b0:4d3:3a78:60e2 with SMTP id r18-20020a05612206b200b004d33a7860e2mr108423vkq.1.1711058889439; Thu, 21 Mar 2024 15:08:09 -0700 (PDT) X-Received: by 2002:a05:6122:6b2:b0:4d3:3a78:60e2 with SMTP id r18-20020a05612206b200b004d33a7860e2mr108396vkq.1.1711058889030; Thu, 21 Mar 2024 15:08:09 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id o6-20020a0562140e4600b00690baf5cde9sm351663qvc.118.2024.03.21.15.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 15:08:08 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Christophe Leroy , Matthew Wilcox , Rik van Riel , Lorenzo Stoakes , Axel Rasmussen , peterx@redhat.com, Yang Shi , John Hubbard , linux-arm-kernel@lists.infradead.org, "Kirill A . Shutemov" , Andrew Jones , Vlastimil Babka , Mike Rapoport , Andrew Morton , Muchun Song , Christoph Hellwig , linux-riscv@lists.infradead.org, James Houghton , David Hildenbrand , Jason Gunthorpe , Andrea Arcangeli , "Aneesh Kumar K . V" , Mike Kravetz Subject: [PATCH v3 02/12] mm/hugetlb: Declare hugetlbfs_pagecache_present() non-static Date: Thu, 21 Mar 2024 18:07:52 -0400 Message-ID: <20240321220802.679544-3-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240321220802.679544-1-peterx@redhat.com> References: <20240321220802.679544-1-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Peter Xu It will be used outside hugetlb.c soon. Signed-off-by: Peter Xu --- include/linux/hugetlb.h | 9 +++++++++ mm/hugetlb.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 300de33c6fde..52d9efcf1edf 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -174,6 +174,9 @@ u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx); pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, pud_t *pud); +bool hugetlbfs_pagecache_present(struct hstate *h, + struct vm_area_struct *vma, + unsigned long address); struct address_space *hugetlb_page_mapping_lock_write(struct page *hpage); @@ -1197,6 +1200,12 @@ static inline void hugetlb_register_node(struct node *node) static inline void hugetlb_unregister_node(struct node *node) { } + +static inline bool hugetlbfs_pagecache_present( + struct hstate *h, struct vm_area_struct *vma, unsigned long address) +{ + return false; +} #endif /* CONFIG_HUGETLB_PAGE */ static inline spinlock_t *huge_pte_lock(struct hstate *h, diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 23ef240ba48a..abec04575c89 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6129,8 +6129,8 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, /* * Return whether there is a pagecache page to back given address within VMA. */ -static bool hugetlbfs_pagecache_present(struct hstate *h, - struct vm_area_struct *vma, unsigned long address) +bool hugetlbfs_pagecache_present(struct hstate *h, + struct vm_area_struct *vma, unsigned long address) { struct address_space *mapping = vma->vm_file->f_mapping; pgoff_t idx = linear_page_index(vma, address); -- 2.44.0