From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C9D8C61D90 for ; Tue, 21 Nov 2023 15:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234842AbjKUP7s (ORCPT ); Tue, 21 Nov 2023 10:59:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234601AbjKUP7p (ORCPT ); Tue, 21 Nov 2023 10:59:45 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED3DD192 for ; Tue, 21 Nov 2023 07:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700582381; 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: in-reply-to:in-reply-to:references:references; bh=JLQMSJj5cT+I2UqS+X9OetiKtxPgKmgg9Mky3rgL5p8=; b=CrAFxo+ydw8C6CbTxUbBIaihHmYR6ig8k/MtfOpRtrd0RljEr+Ya2KItvfoyWQHbsGdFtN h2noGDl4792ZLDm2wOTIapJbDdaB7q9k1gDawGnwsUJY0g1HMu2vLOKe0bGvy8PMMPFRSu 2THHOi/MDiY/3nxa2HMeRhO6qNkJ++A= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-126-Oi8ycVwbPAKbbjhtboo03g-1; Tue, 21 Nov 2023 10:59:39 -0500 X-MC-Unique: Oi8ycVwbPAKbbjhtboo03g-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6716c2696c7so15014396d6.1 for ; Tue, 21 Nov 2023 07:59:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700582379; x=1701187179; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JLQMSJj5cT+I2UqS+X9OetiKtxPgKmgg9Mky3rgL5p8=; b=SvUKpvbJS+u7HYSrHK5/3L+uf5aBTfXEzyM4QJHKorBDNSyBGR/SAySWuP5IcbjmrX aZQXz9GCNHPd4uhswaVdXbdSh85kKyfRYvdDzC2wLMiZpvqFPQT9cGFSS2FQcfcD16I8 Vqtz913x82/xoDTW2Pg7N7930PWxwjdmtPqu6iI51a4gPVT/rsCzMWDwObJ0S62AnFlw pXOz3pC/y1Y7RAo1jvOEVMo6iX9KN0WyqwrM07HCnTi39sxIxvR/Cf20nScg1rs9GAWp qeYRijnrU51dcphavmh1ci2sP7ypb9m8ZusC5ZwGCAskv+L4K5S5Xw9Ts791C7PAYFyw PeBQ== X-Gm-Message-State: AOJu0YwnHxyfVVG8LzQTLOqd2qeF70gwhR4oTAmcCr9jLAoMDgyXSN3J F0Mex+vmjDzcfcRR5vQNWB5mmu6pdsLDira+UtXJVIIRnLy5rd8+CfldvLCKm8g7NwAJFsgfzQY 2ESyIb5ceED2FKYREy9SW597W/U+rzOz7 X-Received: by 2002:a0c:c582:0:b0:66d:1012:c16a with SMTP id a2-20020a0cc582000000b0066d1012c16amr10534463qvj.1.1700582378837; Tue, 21 Nov 2023 07:59:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9jPSayCUuCFnqS3WxavS9ST6O5WwQE1cldTJjdWqW9XI/Aaj5okJ+Mn7wuuqXunOLRSa0AQ== X-Received: by 2002:a0c:c582:0:b0:66d:1012:c16a with SMTP id a2-20020a0cc582000000b0066d1012c16amr10534438qvj.1.1700582378610; Tue, 21 Nov 2023 07:59:38 -0800 (PST) Received: from x1n (cpe688f2e2cb7c3-cm688f2e2cb7c0.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id a12-20020a0562140c2c00b00679d9547310sm2051153qvd.31.2023.11.21.07.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 07:59:38 -0800 (PST) Date: Tue, 21 Nov 2023 10:59:35 -0500 From: Peter Xu To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrea Arcangeli , James Houghton , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , John Hubbard , Yang Shi , Rik van Riel , Hugh Dickins , Matthew Wilcox , Jason Gunthorpe , Axel Rasmussen , "Kirill A . Shutemov" , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Mike Rapoport , Mike Kravetz Subject: Re: [PATCH RFC 06/12] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing Message-ID: References: <20231116012908.392077-1-peterx@redhat.com> <20231116012908.392077-7-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2023 at 12:26:24AM -0800, Christoph Hellwig wrote: > On Wed, Nov 15, 2023 at 08:29:02PM -0500, Peter Xu wrote: > > Hugepd format is only used in PowerPC with hugetlbfs. In commit > > a6e79df92e4a ("mm/gup: disallow FOLL_LONGTERM GUP-fast writing to > > file-backed mappings"), we added a check to fail gup-fast if there's > > potential risk of violating GUP over writeback file systems. That should > > never apply to hugepd. > > > > Drop that check, not only because it'll never be true for hugepd, but also > > it paves way for reusing the function outside fast-gup. > > What prevents us from ever using hugepd with file mappings? I think > it would naturally fit in with how large folios for the pagecache work. > > So keeping this check and generalizing it seems like the better idea to > me. But then it means we're still keeping that dead code for fast-gup even if we know that fact.. Or do we have a plan to add that support very soon, so this code will be destined to add back? The other option is I can always add a comment above gup_huge_pd() explaining this special bit, so that when someone is adding hugepd support to file large folios we'll hopefully not forget it? But then that generalization work will only happen when the code will be needed. Thanks, -- Peter Xu