From nobody Wed Aug 17 23:17:58 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 4M7P840yLkz4ZY4K; Wed, 17 Aug 2022 23:18:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7P835lbJz3XLq; Wed, 17 Aug 2022 23:18:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 27HNHw8O046572 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 18 Aug 2022 02:18:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 27HNHwLE046571; Thu, 18 Aug 2022 02:17:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Aug 2022 02:17:58 +0300 From: Konstantin Belousov To: Gleb Smirnoff 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-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on tom.home X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Rspamd-Queue-Id: 4M7P835lbJz3XLq 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 Wed, Aug 17, 2022 at 03:09:45PM -0700, Gleb Smirnoff wrote: > 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. I still do not understand, from your reply, why do you need to have mbuf-related condition to be defined in the pageout daemon' namespace. It seems that the problem comes from the IMO mis-guided attempt to mix vm_lowmem and mbuf_lowmem events.