netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>,
	'Eric Dumazet' <eric.dumazet@gmail.com>,
	Davide Caratti <dcaratti@redhat.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path
Date: Fri, 16 Nov 2018 06:55:34 -0800	[thread overview]
Message-ID: <2bfef133-8dbf-728c-f815-929291b4c68e@gmail.com> (raw)
In-Reply-To: <a3ed82c1679e4bb5a8ab4233df38a03c@AcuMS.aculab.com>



On 11/16/2018 06:41 AM, David Laight wrote:
> From: Eric Dumazet
>> Sent: 16 November 2018 14:35
> ...
>> I suggest to use a single cache line with a dedicated spinlock and these three s64
>>
>> 	spinlock_t  tcfp_lock ____cacheline_aligned_in_smp;
>> 	s64 			...
>> 	s64			...
>> 	s64			...
> 
> Doesn't this do something really stupid when cache lines are big.
> If the spinlock is 8 bytes you never want more than 32 byte alignment.
> If cache lines are 256 bytes you don't even need that.

We do want that, even if cache lines are 256 bytes, thank you.

> 
> Also ISTR that the kmalloc() only guarantees 8 byte alignment on x86_64.
> So aligning structure members to larger offsets is rather pointless.


No it is not, we use these hints all the time.

Just double check and report a bug to mm teams if you disagree.

Please do not send feedback if you are not sure.

  reply	other threads:[~2018-11-17  1:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 17:29 [PATCH net-next 0/2] net/sched: act_police: lockless data path Davide Caratti
2018-09-13 17:29 ` [PATCH net-next 1/2] net/sched: act_police: use per-cpu counters Davide Caratti
2018-09-13 17:29 ` [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in the data path Davide Caratti
2018-11-15  6:46   ` Eric Dumazet
2018-11-15 11:43     ` Davide Caratti
2018-11-15 13:53       ` Eric Dumazet
2018-11-16 11:28         ` Davide Caratti
2018-11-16 14:34           ` Eric Dumazet
2018-11-16 14:39             ` Eric Dumazet
2018-11-16 14:41             ` David Laight
2018-11-16 14:55               ` Eric Dumazet [this message]
2018-09-16 22:32 ` [PATCH net-next 0/2] net/sched: act_police: lockless " David Miller

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=2bfef133-8dbf-728c-f815-929291b4c68e@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).