Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp486720rdf; Tue, 21 Nov 2023 08:00:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGKBzC0qVGHbHE6xgLlt7tbanns5OfSxIQmwK7m6Z2EJzA2s/2Z6ikFRs88+CR/2EFUm35 X-Received: by 2002:a05:6a00:1988:b0:6cb:a1fe:5217 with SMTP id d8-20020a056a00198800b006cba1fe5217mr7244143pfl.16.1700582401569; Tue, 21 Nov 2023 08:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700582401; cv=none; d=google.com; s=arc-20160816; b=zPh5Yaw5g0RN96bX4g+htB+uL45uOL1C7iwv5r+hkMbEevPyNUEIS+/S1zkk1YD2HI OxxKzexAWR6HMWvXr0Nnfc6orsokbhDfX29bCxtxoDVc3wRVU+SRtxmOGpghtO3WioPS gmXa2AOL+fM+4WlHNNVqRW3FsYtdK6YNFTp5qBj6BlOt0KujsYYOktO9fj6WUK2LLK2q Nw6Suizw34oJ4qU3B8ABjOyTuMK9myKg1ACKNBpRG+G0xq3JX5YIXiX3gwrpVd9SpBq8 bE+4sz52LFoJNrI1PrXaQXJic9Gw9yNMHkt+ggnleFNlp7PToFykSjgBEOatmtW372DM cFNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JLQMSJj5cT+I2UqS+X9OetiKtxPgKmgg9Mky3rgL5p8=; fh=IWrKbpoLTVzPb0+r1p/DZVVOWDvjs8czNeWaRL0gwNI=; b=cY9H45AKzaPeA/5yanWsSdgMDXbmHBlqcsXTlEKGQ1JvU6LSkLInjDn7Q3ezFr68eD Pkn5Lx6PZkIzOGvqoQkq1eagF5vi2ddz00upHcp64nD/A6hhN3IA0RPmtkLAbJexlxsS oSVyYJ/AxCmgygw9eHTdCOSh8SixwSE0oEhQbhV+T29JLtpY2vHAakp44wMh9L2QtT2d IHpNmfyR/WOUewi2GGYzlruy9nnrnl7doQ9YNnvjSDC2XkP2TQfpsP4RhFcD5RScd6lV ulJSXtoVjnNeLglnYQKX+GKK4WlaVZDREB17SRBROH4B+NeOD3R+0rIVFrvJPOorWEN1 b0wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CrAFxo+y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p123-20020a625b81000000b006c0db523732si10039244pfb.136.2023.11.21.08.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:00:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CrAFxo+y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 27CC8802797C; Tue, 21 Nov 2023 07:59:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234846AbjKUP7q (ORCPT + 99 others); Tue, 21 Nov 2023 10:59:46 -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-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: X-Spam-Status: No, score=0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 21 Nov 2023 07:59:58 -0800 (PST) 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