Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4899830rwb; Mon, 31 Jul 2023 14:20:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHhVvsVcsGuVyTqr43r2ulABvSTpO4G0bNRy2QVexkyx+dpBhH/TAP4qDrdFEsn2oXzUSKz X-Received: by 2002:a17:906:9beb:b0:994:4f4a:218c with SMTP id de43-20020a1709069beb00b009944f4a218cmr791997ejc.8.1690838433266; Mon, 31 Jul 2023 14:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690838433; cv=none; d=google.com; s=arc-20160816; b=FgNhUb9NNajdKGEEvGXIB8eLOOfCF1JSpj5VDLRh6vHfsoE5vgFf1quFZEp6jp0HYW kke/yXADwiXffaMH4wJNjZuwpegNeigMVBV0vxGYJw1ii5D6sub01mFRy2D9FTfESHBO 90E9E1NeSEf82kInhX9oiHOAD6jryBBN6+72CCvzohMwpSNo9mvhHXerCAy8W5A2uiWf w5ncOXP7D09rm+F2PGYNh/LDXISlVO8FbVvm2EKbBugR86+hQsWt/bzIpoCFLoobBzxp p6UgN8hA7Ki7Z1hy0aXJxuVF7HgREL9mwYEULE88zTSVds7Jdry+WRF8SbF21DQAXpKT 5E5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=LA1GnFnRaSIrBRgNPCE0W5qOkn+l9NtMHyFumErsVAY=; fh=mIghq38rp7uVBZTAL2dhvo9rl1s8gaiB8QDKgo7HyHc=; b=HqqOvvZiIduZetB9ld+0ZqTjFUjaDLeHMBJHxpXFF+YLq3RST6MOtYiY/smqOW6bqb 2KIiVDgmKvVzhVfOTIkCJq2wIphNN2m154JwcBqZiLt0U+zfusKUVEfUVAC51FYmDguo 79TRuRM2P/QEy49nchdL2fjINmVDm8gPUkGz/v9NuTn1L1duFWDYLRP+5mVXge3AWV7F iAmXlnes/9766ijFs7039pFGPTN4RWoddiQF3iI/BgBR07mt5O1F3DFTozv6si7NjmXN 30fEjPRGkwe8qT6CJuGo9p7SsMHUaoQUyMd2VBai/QITGo74qpg8UMANCFXehq2hKCby ZpTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dCt+PG6O; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a170906815100b0098d9dfee9c7si7724982ejw.493.2023.07.31.14.20.07; Mon, 31 Jul 2023 14:20:33 -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=@kernel.org header.s=k20201202 header.b=dCt+PG6O; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbjGaU7A (ORCPT + 99 others); Mon, 31 Jul 2023 16:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbjGaU65 (ORCPT ); Mon, 31 Jul 2023 16:58:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81CA01996 for ; Mon, 31 Jul 2023 13:58:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 180E461298 for ; Mon, 31 Jul 2023 20:58:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 261EDC433C7; Mon, 31 Jul 2023 20:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690837135; bh=r5eukuyVDYrGLrNULe36nyXrnyzoReTEKShm4Q8CiuA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dCt+PG6O2oxSwfiG6ExP2KO9J0t7rdhKRbVUFewtDhwE1LAbAJYzX8EWR1LE2sh5v gHgaCR6zrK9ZpYFSVVdvhgFH3L1P5+2jCytQ/okSBzgjGy9vXGKQxitU4tXzmNbOdj jZWkd+WUc52ICEK1F1IxEl/IYq1/8lpqRP3dC6XsISK73poSKpXKv0KvyRFCgYK0pC pm3JbaSFAUp3kTofXmIy5P1FVJljLXcs0BCO10yATOYNONfHqyrwxvaYcbu3u5afsD MYvOX4PwewYY7bpkwaEU3NOYYI+HRnSKb+octG2CFPrIAuzcwhebDg1PLOI0Mjx9Qx Xnvlml+b5BgKQ== Date: Mon, 31 Jul 2023 13:58:54 -0700 From: Jakub Kicinski To: Tahsin Erdogan Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Herbert Xu , , Subject: Re: [PATCH] tun: avoid high-order page allocation for packet header Message-ID: <20230731135854.3628918b@kernel.org> In-Reply-To: <20230726030936.1587269-1-trdgn@amazon.com> References: <20230726030936.1587269-1-trdgn@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Tue, 25 Jul 2023 20:09:36 -0700 Tahsin Erdogan wrote: > @@ -1838,6 +1838,9 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, > */ > zerocopy = false; > } else { > + if (linear == 0) > + linear = min_t(size_t, good_linear, copylen); nit: would you mind changing to !linear instead of linear == 0 ? Also - I don't see linear explicitly getting set to 0. What guarantees that? What's the story there? Otherwise seems reasonable. One more allocation but hopefully nobody will notice. -- pw-bot: cr