Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1000300rwd; Sat, 27 May 2023 09:29:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71PxLPMBbJyQpwMpeIiJ+so+xIGYoOTQWup/ziBZOuw/Rq00TnNAcozIp8SxMB+uiE7Ihu X-Received: by 2002:a17:90a:d78e:b0:253:360a:f6b with SMTP id z14-20020a17090ad78e00b00253360a0f6bmr6044461pju.13.1685204961836; Sat, 27 May 2023 09:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685204961; cv=none; d=google.com; s=arc-20160816; b=APUHUAWq3Me/Srq19glAoNOXh+/JIy8mCsIwz9gZshzGwaGPkXJK7gr3cKhRIjVIGD R88rIBE4EqBsk6ErEx96nJFc4XvBLgR9SPo++LuTYX0LYONbPsqQNRWGDCTEQ6S+qsC1 Xlg25BwqMN/rK+9CA/alVbrLPEXTeL0KxEPHfjXTPCkTmHf1narQ5b+vGlpujloflGJF M+RRN9hew6UgKQreU0xv8nLH3Ej5CAqsQZvj8DwWoBYVHQo0C5ngKkKb/t8GwnTkNwTJ ZMFBaR2rII1aBrwZHsRjjDGtZhjdsO6i9oo4/T7sDiHNy53mAzgee15jKfpgouCk83IC uovg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qZ/1f+H9JrSTH8ywSfAAbH2Cj7OIgM+7OnWkNZ9G6/M=; b=d80DJHkEjXfrPYbrOFFREUVp/5ZPC+oiSHTtyBJcXn3wo8D+Sn/40B4dPza59z/pmM Q7EJSD6xZyiiUJmlfPUmG4BFG681r4Fu5S1L2zAXdOGO71zeLh8vqsB0Pk76HFqiK54D RijNlplIrrIP39Xtqj5caw2HjLXNhO+Lx9hp+8V8nurxF4aETx9N2RY56viGzC+FETnq +UO9DGstUmD7vJRLbUhSfUEgNBw3LcN8twE3J6AWGEfZm23cABN9eCozF9ODcLYkv+o9 GWg9Nd/FGc00yDki9zyY+atY57Jjt7SstlfWyj0a1d6lGcYt5WeuUc6q/vdf44ENGKdn dLMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rWmpr8Dk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a17090a1f4600b00250807ec16dsi8495956pjy.97.2023.05.27.09.29.09; Sat, 27 May 2023 09:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rWmpr8Dk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232170AbjE0Pz3 (ORCPT + 99 others); Sat, 27 May 2023 11:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231829AbjE0Pz2 (ORCPT ); Sat, 27 May 2023 11:55:28 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B45BA2; Sat, 27 May 2023 08:55:27 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-64d2a613ec4so1441198b3a.1; Sat, 27 May 2023 08:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685202926; x=1687794926; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qZ/1f+H9JrSTH8ywSfAAbH2Cj7OIgM+7OnWkNZ9G6/M=; b=rWmpr8DkC1PTeJ+ruz6WeYjVl72SKKE6L1OzdPejDPoSAW7zXmZBUw05Qrt26S9C9K U8JnJZ5vNM2ey8vstjtpFowukp0q7XfWY2JXtuYDLVNZoKAmgGFXv3AH3K5cpcaz6yzA tx91B1UH6oX8Yj1XcUfOG7FXKm07iJHD7w0wWjDwLfpPsf1Ztx3fCMZZCZ1yRYuid12c hZjLS5sLbyBGPteYx+LmLRsBwT2IK3Km1i7IeAe/4St8n9Um0UQ5B5cMIWj/X1fsPudq wfXqVoiC2glYv8qzoHIMH8l1e1p/1kUSfdOSTb1NwubYxiVsbSN+YVuhQB/kWWU02/Dt K3hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685202927; x=1687794927; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qZ/1f+H9JrSTH8ywSfAAbH2Cj7OIgM+7OnWkNZ9G6/M=; b=QJRJIPppE+x5vJGs64GkBr0meoomSkN21EV5VDLppttTjBpd6/QQz4ezMSc322AK1F QtUlokUNBWWyTZmVkmeeUdVoJFFgYIVK5zux5N8EHhMAf8x+8TWjehsR2zH9ol3/GlwA zsQrIwywuuVkMUZoQotav9IZh29J0vy7juUNQKBY7dpOirXg+v/epgWsgyklkgAWhOd9 +KLXvmHQakftYgkLVHIW7rqA04QturrAbEe/JRcZdexDqr0t9O0TwT5smhOlIlHmzlcU N5elto6w4XfxZ8fo860PdAYmoXaWL6QlgbDxEBvB2DnypAJ5MgtuDTbSTojN1tYuj0KA ceeQ== X-Gm-Message-State: AC+VfDxQ3a0xcRbv+xi7QPAQq6aLI8KC8AImEXh0tCOGdd6pwcgLtV/v tA2/dpY/ADy4HyAwRUyBmx7yMG39pVcapi5FHNQ= X-Received: by 2002:a05:6a20:4428:b0:ff:a820:e060 with SMTP id ce40-20020a056a20442800b000ffa820e060mr4237395pzb.20.1685202926525; Sat, 27 May 2023 08:55:26 -0700 (PDT) MIME-Version: 1.0 References: <20230524153311.3625329-1-dhowells@redhat.com> <20230524153311.3625329-6-dhowells@redhat.com> <20230526175736.7e75dcf9@kernel.org> In-Reply-To: <20230526175736.7e75dcf9@kernel.org> From: Alexander Duyck Date: Sat, 27 May 2023 08:54:50 -0700 Message-ID: Subject: Re: [PATCH net-next 05/12] mm: Make the page_frag_cache allocator handle __GFP_ZERO itself To: Jakub Kicinski Cc: David Howells , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jeroen de Borst , Catherine Sullivan , Shailend Chand , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-nvme@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2023 at 5:57=E2=80=AFPM Jakub Kicinski wr= ote: > > On Wed, 24 May 2023 16:33:04 +0100 David Howells wrote: > > Make the page_frag_cache allocator handle __GFP_ZERO itself rather than > > passing it off to the page allocator. There may be a mix of callers, s= ome > > specifying __GFP_ZERO and some not - and even if all specify __GFP_ZERO= , we > > might refurbish the page, in which case the returned memory doesn't get > > cleared. > > I think it's pretty clear that page frag allocator was never supposed > to support GFP_ZERO, as we don't need it in networking.. So maybe > you're better off adding the memset() in nvme? > > CCing Alex, who I think would say something along those lines :) > IDK how much we still care given that most networking drivers are > migrating to page_poll these days. Yeah, the page frag allocator wasn't meant to handle things like this. Generally the cache was meant to be used within one context so that the GFP flags used were consistent between calls. Currently the only thing passed appears to be GFP_ATOMIC. Also I am not a big fan of pulling this out of page_alloc.c The fact is that is where the allocation functions live so it makes sense to just leave it there. It isn't as if there is enough code added in my point of view to create yet another file and make it harder to track git history as a result.