All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Anastasov <ja@ssi.bg>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Simon Horman <horms@verge.net.au>,
	lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	Jiri Wiesner <jwiesner@suse.de>,
	yunhong-cgl jiang <xintian1976@gmail.com>,
	dust.li@linux.alibaba.com
Subject: Re: [PATCHv7 0/6] ipvs: Use kthreads for stats
Date: Thu, 8 Dec 2022 19:03:44 +0200 (EET)	[thread overview]
Message-ID: <1866fdd6-dff-67b5-cd66-41bc8962957d@ssi.bg> (raw)
In-Reply-To: <Y5HV0EpOrQtdU11y@salvia>


	Hello,

On Thu, 8 Dec 2022, Pablo Neira Ayuso wrote:

> On Thu, Dec 08, 2022 at 01:06:14PM +0100, Pablo Neira Ayuso wrote:
> > On Tue, Nov 22, 2022 at 06:45:58PM +0200, Julian Anastasov wrote:
> > > 	Hello,
> > > 
> > > 	This patchset implements stats estimation in kthread context.
> > > It replaces the code that runs on single CPU in timer context every
> > > 2 seconds and causing latency splats as shown in reports [1], [2], [3].
> > > The solution targets setups with thousands of IPVS services, destinations
> > > and multi-CPU boxes.
> > 
> > Series applied to nf-next, thanks.
> 
> Oh wait. I have to hold this back, I have a fundamental question:
> 
> [PATCHv7 4/6] ipvs: use kthreads for stats estimation
> 
> uses kthreads, these days the preferred interface for this is the
> generic workqueue infrastructure.
> 
> Then, I can see patch:
> 
>  [PATCHv7 5/6] ipvs: add est_cpulist and est_nice sysctl vars
> 
> allows for CPU pinning which is also possible via sysfs.
> 
> Is there any particular reason for not using the generic workqueue
> infrastructure? I could not find a reason in the commit logs.

	The estimation can take long time when using
multiple IPVS rules (eg. millions estimator structures) and
especially when box has multiple CPUs due to the for_each_possible_cpu
usage that expects packets from any CPU. With est_nice sysctl
we have more control how to prioritize the estimation
kthreads compared to other processes/kthreads that
have latency requirements (such as servers). As a benefit,
we can see these kthreads in top and decide if we will
need some further control to limit their CPU usage (max
number of structure to estimate per kthread).

Regards

--
Julian Anastasov <ja@ssi.bg>


  reply	other threads:[~2022-12-08 17:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 16:45 [PATCHv7 0/6] ipvs: Use kthreads for stats Julian Anastasov
2022-11-22 16:45 ` [PATCHv7 1/6] ipvs: add rcu protection to stats Julian Anastasov
2022-11-22 16:46 ` [PATCHv7 2/6] ipvs: use common functions for stats allocation Julian Anastasov
2022-11-22 16:46   ` Julian Anastasov
2022-11-22 16:46 ` [PATCHv7 3/6] ipvs: use u64_stats_t for the per-cpu counters Julian Anastasov
2022-11-22 16:46 ` [PATCHv7 4/6] ipvs: use kthreads for stats estimation Julian Anastasov
2022-11-22 16:46 ` [PATCHv7 5/6] ipvs: add est_cpulist and est_nice sysctl vars Julian Anastasov
2022-11-22 16:46 ` [PATCHv7 6/6] ipvs: run_estimation should control the kthread tasks Julian Anastasov
2022-12-08 12:06 ` [PATCHv7 0/6] ipvs: Use kthreads for stats Pablo Neira Ayuso
2022-12-08 12:17   ` Pablo Neira Ayuso
2022-12-08 17:03     ` Julian Anastasov [this message]
2022-12-09 20:58       ` Pablo Neira Ayuso
2022-12-10  0:47         ` Julian Anastasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1866fdd6-dff-67b5-cd66-41bc8962957d@ssi.bg \
    --to=ja@ssi.bg \
    --cc=dust.li@linux.alibaba.com \
    --cc=horms@verge.net.au \
    --cc=jwiesner@suse.de \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=xintian1976@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.