From nobody Sat May 21 15:59:05 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E66021B3997B; Sat, 21 May 2022 15:59:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L57Z54m51z4bbh; Sat, 21 May 2022 15:59:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-il1-x136.google.com with SMTP id b11so7263933ilr.4; Sat, 21 May 2022 08:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SeT+2ZeW7MZwzLbYeNt13cQ0jtWSmHuIp6UdXPhHJ4I=; b=cnyPu1k2xvXcy6jYwDkHfzG5olHZDE6XWw3Ib1nkrd5AaKl0bI38ILexcF6edVhYdj hxAVYnUibxXzD4Yc9JHNQYw0Mo/MBcULPdLYSXBgcpAZHL3oXwWI7Qzd3QkpSzCf8vgY MFqB+iX/RRcreqNOzaC6D40RsO7gC/7rjm9VRYsAh07D9yjZwavzEHtK7n7cDgc1wceI 1H6A9qrUEBnUhrhvHUZU02z0tNJncisVaUlGo1qN5cdUR6gsT10MzjKdoZZLHFCO8eUv nrbOERaT0cN2v9NOK6Ui5KZr4GNQ5iP3+8Lh75ORmh246u24uWnWh1uqBJ/PzXm+2GVw MlnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=SeT+2ZeW7MZwzLbYeNt13cQ0jtWSmHuIp6UdXPhHJ4I=; b=jPoqWVRTZOVFhrOGFg0EN5kLszGmX9qjNZgtmdRC54wFNdKGLslF6QAJ4um695mExG hkKs7/LN/1VGiLdvJA2uiZa6KXk1v+YQdG+Bd647TgJ3853RLIIZoKlw8QZL3OF1YXAo 5sKb+2GR0OArbropC+Vpjo4E2cY7uEW/o/PwGuxZIZ6ictc6zzbnDTe930v9k+yyWZwH UyZ36V1sKZEkaCOfto3d+aCz0EqxQGc/uQRTxs/pMmRkPrS2z53pG3n33tj90USxk4Te 0Mj3MpdK//UzpMGJO5JeqSo94FjJo841UchqrlG9mbWfF9nEhrLgnNqepg9sH9XBZYLc Nn3A== X-Gm-Message-State: AOAM532FaU96uWoKH/giWv5QhTnT0XozUIgY4IbGGujyWe/4Ym9DnZa+ bTxzbYlVMRC4OCn2S5qq0T8zLOOsHO0= X-Google-Smtp-Source: ABdhPJwgCCHpImaLjDYXwQH0VbAoUVbUTaRzyCvMlkyb86CKlpKx/9xMQA+q1SRZMfdBOlLTGSnXiQ== X-Received: by 2002:a05:6e02:16c7:b0:2cf:610:e217 with SMTP id 7-20020a056e0216c700b002cf0610e217mr8279835ilx.273.1653148748787; Sat, 21 May 2022 08:59:08 -0700 (PDT) Received: from nuc (198-84-189-58.cpe.teksavvy.com. [198.84.189.58]) by smtp.gmail.com with ESMTPSA id n42-20020a02716a000000b0032ead96ee5csm610585jaf.165.2022.05.21.08.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 08:59:07 -0700 (PDT) Date: Sat, 21 May 2022 11:59:05 -0400 From: Mark Johnston To: Sergey Kandaurov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fcaa890c4469 - main - mbuf: Only allow extpg mbufs if the system has a direct map Message-ID: References: <202111161852.1AGIqhxc017891@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4L57Z54m51z4bbh X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, May 21, 2022 at 06:58:39PM +0400, Sergey Kandaurov wrote: > On Tue, 16 Nov 2021 at 22:52, Mark Johnston wrote: > > > The branch main has been updated by markj: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=fcaa890c4469118255d463495b4044eef484fa3e > > > > commit fcaa890c4469118255d463495b4044eef484fa3e > > Author: Mark Johnston > > AuthorDate: 2021-11-16 18:31:04 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-11-16 18:31:04 +0000 > > > > mbuf: Only allow extpg mbufs if the system has a direct map > > > > Some upcoming changes will modify software checksum routines like > > in_cksum() to operate using m_apply(), which uses the direct map to > > access packet data for unmapped mbufs. This approach of course does > > not > > work on platforms without a direct map, so we have to disallow the use > > of unmapped mbufs on such platforms. > > > > I believe this is the right tradeoff: we only configure KTLS on amd64 > > and arm64 today (and one KTLS consumer, NFS TLS, requires a direct map > > already), and the use of unmapped mbufs with plain sendfile is a recent > > optimization. If need be, m_apply() could be modified to create > > CPU-private mappings of extpg mbuf pages as a fallback. > > > > So, change mb_use_ext_pgs to be hard-wired to zero on systems without a > > direct map. Note that PMAP_HAS_DMAP is not a compile-time constant on > > some systems, so the default value of mb_use_ext_pgs has to be > > determined during boot. > > > > Reviewed by: jhb > > Discussed with: gallatin > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D32940 > > --- > > sys/kern/kern_mbuf.c | 32 ++++++++++++++++++++++++++++++-- > > sys/rpc/rpcsec_tls/rpctls_impl.c | 2 +- > > 2 files changed, 31 insertions(+), 3 deletions(-) > > > > diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c > > index d1f2fd2bd9e4..78a270189a4b 100644 > > --- a/sys/kern/kern_mbuf.c > > +++ b/sys/kern/kern_mbuf.c > > @@ -116,9 +116,26 @@ int nmbjumbop; /* limits number > > of page size jumbo clusters */ > > int nmbjumbo9; /* limits number of 9k jumbo clusters */ > > int nmbjumbo16; /* limits number of 16k jumbo > > clusters */ > > > > -bool mb_use_ext_pgs = true; /* use M_EXTPG mbufs for sendfile & TLS */ > > -SYSCTL_BOOL(_kern_ipc, OID_AUTO, mb_use_ext_pgs, CTLFLAG_RWTUN, > > +bool mb_use_ext_pgs = false; /* use M_EXTPG mbufs for sendfile & TLS */ > > > > Hi, > > Does it mean that mb_use_ext_pgs has to be enabled manually now > in head and releng/13.1 ? (it was on by default in releng/13.0) > I failed to see how it still can be on by default from this change. > > What about initializing to true under #if PMAP_HAS_DMAP ? This is my mistake. The intent was to have mb_use_ext_pgs set to true when there is a direct map. I fixed the problem in main, but failed to MFC the fixup. :( I've merged the fixup to stable/13 now. We could release an EN for this, but there is a simple workaround at least.