lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Mar 2018 08:16:13 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        sthemmin@...rosoft.com
Subject: Re: [PATCH] inet: add bound ports statistic

On Wed, 28 Feb 2018 20:28:15 -0800
Eric Dumazet <eric.dumazet@...il.com> wrote:

> On Wed, 2018-02-28 at 22:32 -0500, David Miller wrote:
> > From: Eric Dumazet <eric.dumazet@...il.com>
> > Date: Wed, 28 Feb 2018 18:28:02 -0800
> >   
> > > How useful it is to report this information ?
> > > 
> > > Given REUSEADDR and REUSEPORT, I really wonder what can be derived from
> > > this counter.
> > > 
> > > It seems its semantic is weak.  
> > 
> > To me none of this really matters.
> > 
> > What matters is that iproute2 reported this via slabinfo for longer
> > than a decade.
> > 
> > It broke recently when SLAB started merging caches just like SLUB
> > always did.  
> 
> 
> Linus himself removed some info that was much more useful in
> commit a5ad88ce8c7fae7d ("mm: get rid of 'vmalloc_info' from
> /proc/meminfo")
> 
> # egrep "VmallocUsed|VmallocChunk" /proc/meminfo
> VmallocUsed:           0 kB
> VmallocChunk:          0 kB
> 
> So I vote for not re-adding another loop in the kernel with no
> preemption point.
> 
> Simply taking spinlocks like Stephen did is going to slow down the
> other threads, lets face it.
> 
> This implementation has a high cost, and provides something that made
> no sense in the first place.
> 

I went through a several possible alternatives.
   1. Add a counter in the hash bucket head (like listen already has).
      But not namespace aware
   2. Add a percpu counter in network namespace (new struct tcp_netns)
      Logical and adds place to move tcp open sockets as well.
      But more expensive and several places in code don't have easy
      access to namespace.
   3. Counting entries in userspace; defeats the purpose of -s flag.

Agree it is not an urgent statistic, it is just it got broken; willing to
just drop it.

What about adding cond_resched between buckets like other places do?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ