From patchwork Wed Mar 27 15:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13606783 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BA31C47DD9 for ; Wed, 27 Mar 2024 15:23:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 11B246B0082; Wed, 27 Mar 2024 11:23:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C8966B0092; Wed, 27 Mar 2024 11:23:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF3486B0096; Wed, 27 Mar 2024 11:23:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A90EC6B0082 for ; Wed, 27 Mar 2024 11:23:46 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 69F5C140DD7 for ; Wed, 27 Mar 2024 15:23:46 +0000 (UTC) X-FDA: 81943188852.08.4406278 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 5FBC340003 for ; Wed, 27 Mar 2024 15:23:44 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XlUc7hCJ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711553024; h=from:from:sender: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:dkim-signature; bh=/DKy2rskdC2Yvy4b+7pXCefd1yMSUUO/lg/gxYCRDGA=; b=UJXnegEp9WfcNyx7mcSM1KsqMVbUQsFyRH1/U2M9JbR/w2FuCDWAgMA+kpC2kOnM44Hxsn v/f0fpv31mUv0hWGV8Sew7zWStEu/oaX9LDMrs3Yw33LSqmPXRljcPR9HeQLPu2Fifyyn3 naLvHXt34YqSZMbk3qjx1wmJEF75ilk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XlUc7hCJ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711553024; a=rsa-sha256; cv=none; b=I7giWj+5ywt80eBy0w/T0GW19bITlpoWJJEs7Y30NIFecHRBXTch8QQTS8o4bxaivxo+SC jSFIHc00ah+SzKEBujz03lzr8nLrHQOnj3qIPv0wGerTLx6FIEMe+NfXLf0thARpiW6g4Y Hfo1vo2jv64piq4DjkH9ePxpNsq5jbA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711553023; 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=/DKy2rskdC2Yvy4b+7pXCefd1yMSUUO/lg/gxYCRDGA=; b=XlUc7hCJlcVqjBmKtdtMMEJJKeTdwY7QKS4DuNNHANJzCg/A8NHvCcm5PLfbl8xwOjmthD OcGdI/91Qt0YEaRWlkIxuUdpJoThP4ExCF0L73NG/mltslt/KY0IiEnbU2Iuu2NaZWMehV PaY2JzPbCJBPSMPMpMtLQKrLEmE0awU= Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-527-S2JESGfUNS-rExgcMtnFvQ-1; Wed, 27 Mar 2024 11:23:41 -0400 X-MC-Unique: S2JESGfUNS-rExgcMtnFvQ-1 Received: by mail-oi1-f198.google.com with SMTP id 5614622812f47-3c377528ca3so585634b6e.1 for ; Wed, 27 Mar 2024 08:23:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711553020; x=1712157820; 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=/DKy2rskdC2Yvy4b+7pXCefd1yMSUUO/lg/gxYCRDGA=; b=mXkyfApmueHup13MeaYYmAw3lCgVDBrwbBr9lys5e6ARZHpmcypnGtW+7gAlftHBc6 In0Qe8FzmErWAxoYRmoUOBNfzbmF3JpakD+q3ysVikRrv1g2JRGjyde616MglLkTjbxQ mJZekGIKZ0r/7B9wP+54bPt+1FHYUIe5FEyUQAh8OdFp/NGKGHhqSFmLlDFDkKooO1MW dv4ylAf+jBJ3W7PSivGX4mrbfYQIUOpw7Cwp56T869vBMN0JXytFMxMcA+6EIoxPArA3 IRGO3AWQbaqkfrxAjJWyQBYUzBSlN1/OgP4fmslimPPlI95aPknHgFaKnwEgxAUkP2bK EpZA== X-Gm-Message-State: AOJu0YzwSZbJeKHcAp+sEb2cu2qWIiouYXiioqYux78+18p01BvzjbOR CmcfVkoKSL4Rjw+SxKEC38SMhgyLNhHwCjqI8OrsOqigsWIZJeXuYZYQtBp+nJ9/8ysY3F/8ICs cJP5bfvZGZxC/IUiC3VAATq+6qJ3R3vfsct+Smv2MbrNhJIoWmEEnThI3qAc79T5VBPI5avay4l 1xe0Kg+HmIvM1fb/Z9waLzehXaLHCAkA== X-Received: by 2002:a05:6808:1814:b0:3c3:d28a:b1a8 with SMTP id bh20-20020a056808181400b003c3d28ab1a8mr370375oib.0.1711553020238; Wed, 27 Mar 2024 08:23:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUSCRMAKzeIW51sHYtQ4kGfBJ1LCcy7xm5bPm4kr5W7dAQlFQDGhJMDaaF/OcaFnro9iqkpQ== X-Received: by 2002:a05:6808:1814:b0:3c3:d28a:b1a8 with SMTP id bh20-20020a056808181400b003c3d28ab1a8mr370311oib.0.1711553019443; Wed, 27 Mar 2024 08:23:39 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id hu4-20020a056214234400b00690dd47a41csm6412639qvb.86.2024.03.27.08.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:23:38 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Yang Shi , "Kirill A . Shutemov" , Mike Kravetz , John Hubbard , Michael Ellerman , peterx@redhat.com, Andrew Jones , Muchun Song , linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Christophe Leroy , Andrew Morton , Christoph Hellwig , Lorenzo Stoakes , Matthew Wilcox , Rik van Riel , linux-arm-kernel@lists.infradead.org, Andrea Arcangeli , David Hildenbrand , "Aneesh Kumar K . V" , Vlastimil Babka , James Houghton , Jason Gunthorpe , Mike Rapoport , Axel Rasmussen Subject: [PATCH v4 02/13] mm/hugetlb: Declare hugetlbfs_pagecache_present() non-static Date: Wed, 27 Mar 2024 11:23:21 -0400 Message-ID: <20240327152332.950956-3-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327152332.950956-1-peterx@redhat.com> References: <20240327152332.950956-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: 5FBC340003 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: xnfa93qep5j5t19cxpphjax6qk9o1tj5 X-HE-Tag: 1711553024-826 X-HE-Meta: U2FsdGVkX19QqPTNqr3+xxj7bpKbJLVmJd5VQSX76jGfHVJXcgH4TkbAVg7DZLAxxYhjRYPUsUd6FO7bddxZw7Q4M664HCLI0lF8qBXcAu0639rGTqDz6n4DRJmQo/i9qMlkMIEzdlRZG/kq/9r36plo+xHxu1QHj54OqkrGJncJXgUxny6gopb0RA1isnWIm7+NbQAycr2xrUTiKyIa2v5m375kuWfLJrNeMeKmQcULsDuquboTMSSXnPkHFN4gQV1wR98ECpKuaXYNspyO0QSJxF9lE0fxhvOno1N14+NQNjeI4hDzozuwjbN6MAa0mUfhzUuHK1cpRF4uQR9IXkEvEomJvCFzb+v86Z5wZ2/Pl74NJ4oWRQRVhJ2neMsOVg8/jtNlJDd1KWYVuEw0PaWUqf2iPHi+85yLwrzEzKPTZNsq1eayyEflo0ncZDyVDe706dVnEdlLnTBEtINe7puGDWw+41Fgf+XvqJu5cAiQgCOcPURanLYLOItKyk+dTBridbaiSp+SjyQ+6PIhZ6Z0qYcwqLLxfWkkwCV59IZBR/v84ByaKtMUocryvXdWjLNzcujo/NeX2wak9ksbKqwO43Zvci1yTqym84HtxwasiFRBiPTBzlcEJyC5NILv9DJxdtLUDt3gQmoMQnQTKWE0oyhd8IJCPgnvaz451srt5bgzoXsBBxGvlNSqUE3fKDke9h/14ajs+f56yuSndDdI8K4KxRm9otTPIaq3NIIBjmM+PSfRPk4p9aUUTyVBATVlxk9uVph9F2RBH160MXznrkm4GviweytxZcYw1HZpC5ILW9ib4q9SFXFkXosvD4Puij1U2mbjhIw22W+vhWOudYhh5DTRXDMR9Qmiq0oA49ommSOiAyolMm0eD2PPkxgJx/VWYejfUb6bH9trETQ+T/VbL5hLzBzvXLroHfM/EeMiSGuvy+f4RiwKSVROVA1uOFMR7SiuqSUBW4+ dz+hmGT0 30vPDxYBnsKdhWM1xaY9JX8Zm7ChrXuKREsbupft1KWt4L7QRP5eX5Ol5Ml/JuRhtil5ghFMBSuF963ErpfYYMZ+Y2M0gwq6OZFGGsA+cozzAbUwtM+SG7HCycgqjPBJrxfS7nL3Fgefg4kFD9JQTylNH7gmbuiEQS0n5IHY0NyjhAO4tlWNiiy6KPnnGLDgCPIauxiYIaoW1fdNeUsX+JNxx7ovZYujd1lRonSjXfyDYv1XCHX0BN45cqIwe19kMX6MD5HYmfHNRICBn4lRGdMFhdNTark1qwdMPup7Ar6sK7qG4e1ZPRTjLBXKNqhvPw81tPsVJYrkZ3/hLkaJp12s1opBnwoJQ1kjc8+bbBZUxkoZ21LqII9PLuwSE5BW+KrZvGsdCpVyyoaJahVwa6xCB+G7vJBe1Trz0p2M97p3siBxwVgw3x6MYlw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 d748628efc5e..294c78b3549f 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); @@ -1228,6 +1231,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 f9640a81226e..65b9c9a48fd2 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6110,8 +6110,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);