From nobody Wed Aug 17 22:09:45 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 4M7Md80vlKz4ZQ6L; Wed, 17 Aug 2022 22:09:48 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7Md767yZz3Rtl; Wed, 17 Aug 2022 22:09:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 27HM9jvS032955 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 17 Aug 2022 15:09:45 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 27HM9jmp032954; Wed, 17 Aug 2022 15:09:45 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 17 Aug 2022 15:09:45 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 81a34d374ed6 - main - protosw: retire pr_drain and use EVENTHANDLER(9) directly Message-ID: References: <202208171852.27HIqL67013112@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-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4M7Md767yZz3Rtl X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Aug 18, 2022 at 12:44:24AM +0300, Konstantin Belousov wrote: K> > protosw: retire pr_drain and use EVENTHANDLER(9) directly K> > K> > The method was called for two different conditions: 1) the VM layer is K> > low on pages or 2) one of UMA zones of mbuf allocator exhausted. K> > This change 2) into a new event handler, but all affected network K> > subsystems modified to subscribe to both, so this change shall not K> > bring functional changes under different low memory situations. K> > K> > There were three subsystems still using pr_drain: TCP, SCTP and frag6. K> > The latter had its protosw entry for the only reason to register its K> > pr_drain method. K> > K> > Reviewed by: tuexen, melifaro K> > Differential revision: https://reviews.freebsd.org/D36164 K> ... K> K> > diff --git a/sys/vm/vm_pageout.h b/sys/vm/vm_pageout.h K> > index 82ba3c81ef1b..63d31dc1d135 100644 K> > --- a/sys/vm/vm_pageout.h K> > +++ b/sys/vm/vm_pageout.h K> > @@ -87,6 +87,7 @@ extern int vm_pageout_page_count; K> > */ K> > #define VM_LOW_KMEM 0x01 K> > #define VM_LOW_PAGES 0x02 K> > +#define VM_LOW_MBUFS 0x04 K> K> This is very weird, to put it mildly. As said in the commit message the old code called the pr_drain for two very different events and new code just preserves old behavior. I didn't create the weirdness, I exposed it :) I'm open to redesigning this. This probably needs to be done separately for every protocol and tested in real life conditions that indeed trigger these events. -- Gleb Smirnoff