From patchwork Thu Mar 21 22:07:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13599425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36DBFC54E58 for ; Thu, 21 Mar 2024 22:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c0f3SWxf2cEXNmauLhc9pEn4eGa2eY4Yk/Tjbssk9yM=; b=BG3O+AS+H1ZUbf fW4nS+mVrw6uCl/kK3UvZoxrFopbRZjL8b2M7o6QM60sWy5MIA+iTyscfX2k7eRnw7/BhLkN13HQs T1DkiaLwzpVvo6PgMbY9ukMBQuBRQ6g4CRHrAcd1KyL0wT4hw6mOx3w79BUdazXqqyOO5ZYY5b9RS XFmRGLmdI7F1PDpb4zwHgJbu5Ks4DcOmpZxx1KVj/tMsFwttLkWw6mKqIkVbOgO/DHOOlqPK0D502 NfTPj5N0hMzhtoL/6VLNq/DxOJJeJFATxWsMbJHolBk0YwZU6/OJ2RSgVaXjHyQmozyEGef/KH3xQ rpVQYCTNEniEAv2r6Ujg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnQbY-00000004rKJ-0tjK; Thu, 21 Mar 2024 22:09:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnQa5-00000004qGP-1ezt for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 22:08:15 +0000 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jz9rMLZ3uXx9gi3+G5qYwalRYpIGEA6fjYlj3iYlq7A=; b=Y5OGlwCohUm85fF8pPE2ItbRk/dkc2xD/b+FM39jWqS9yqFh9RalXOBoTGsVYXywhGziP/ fn8MLhnjSBgMR81+YDen+oMZ/BiMj5WIOf4l9vDu6Nmy/GS+f0uGoU7QabkNtkQar0CaPs hf72RG2rO9AntZdM2JMVAzKF7mrJXKw= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-52-X6c3CF5ZMoqDA-UZtS3FAA-1; Thu, 21 Mar 2024 18:08:10 -0400 X-MC-Unique: X6c3CF5ZMoqDA-UZtS3FAA-1 Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-476ce1f0571so76925137.0 for ; Thu, 21 Mar 2024 15:08:09 -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=ZJZ84BsWVGjuVm++cq3e4+se8TKt+t5qpucj421YKtIMy91V7ffTDOg+qDC5qY88PS b6BdekgPoPO2I1RsWEDcd+9A6mj1flUg+vACOWIEgutxYhImw6Y9oYXLCrfGsd8Eu+Yw fIly07RlGHWD1yKDuviH5qiFwj3Zhqonz2+qJcWFWldFU4opXKo5X61ZGehavj4x8eHZ MujJl7D9KAasihlzJoKDyQM/7t9w+dF712/4RMRp3W+QPZzLBYZSVjQZCRmeYPrSSxZj j/afLdPj7uWGPNvUii0lIZSgcvlgJ2mLeTgGIo/dlaYswS5tKRMB2u32Pbc2qUFvJVh/ GRQQ== X-Forwarded-Encrypted: i=1; AJvYcCXMQx+lgr7hS4cwWzCu1g2F7MEZxsdV1p4ug3nwVEVHmWcqhN2w0OUTGGNqf7P1o+osszzNt0XzHzOFye38KB+RNkr1/DeML8EAgAElzAIp86jyApo= X-Gm-Message-State: AOJu0YzfXz5tGDUn6i5rb2ycIDEsrp6SpgDqaFyM7udFRmihRX0evE1Y TeLSaEruq8X6dUH5HLzid1U2nkyxQnVRsWuw6ljhnYYsuykzmola8al/ISAi+Kwg6wyKTbfetHB A7T/OpRv7GyKNrLw9k8rX9RptH8OFXKnW30iu2LUkqosjmtA3FnbwhmiYc9/6nI+USMwrnWzu X-Received: by 2002:a05:6122:6b2:b0:4d3:3a78:60e2 with SMTP id r18-20020a05612206b200b004d33a7860e2mr108426vkq.1.1711058889443; Thu, 21 Mar 2024 15:08:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYDbaW1J9E1O0bYtn9bzXmgf1WJ4RRo+0b7nGhM7jp1NUFRItVBXPR4HtJOs8C30IHezp50w== 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> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_150813_579547_7BA8CE30 X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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);