DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"olivier.matz@6wind.com" <olivier.matz@6wind.com>,
	"andrew.rybchenko@oktetlabs.ru" <andrew.rybchenko@oktetlabs.ru>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"honnappa.nagarahalli@arm.com" <honnappa.nagarahalli@arm.com>,
	"bruce.richardson@intel.com" <bruce.richardson@intel.com>,
	nd <nd@arm.com>
Subject: RE: [PATCH v2] mempool: micro-optimize put function
Date: Fri, 23 Dec 2022 16:34:09 +0000	[thread overview]
Message-ID: <b69b8a25d51b44d6ac46482d47354f05@huawei.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D875DE@smartserver.smartshare.dk>



> > Hi Morten,
> >
> > > PING mempool maintainers.
> > >
> > > If you don't provide ACK or Review to patches, how should Thomas know
> > that it is ready for merging?
> > >
> > > -Morten
> >
> > The code changes itself looks ok to me.
> > Though I don't think it would really bring any noticeable speedup.
> > But yes, it looks a bit nicer this way, especially with extra comments.
> 
> Agree, removing the compare and branch instructions from the likely code path provides no noticeable speedup, but makes the code
> more clean.
> 
> > One question though, why do you feel this assert:
> > RTE_ASSERT(cache->len <= cache->flushthresh);
> > is necessary?
> 
> I could have written it into the comment above it, but instead chose to add the assertion as an improved comment.
> 
> > I can't see any way it could happen, unless something is totally broken
> > within the app.
> 
> Agree. These are the circumstances where assertions can come into action. With more assertions in the code, it is likely that less code
> executes before hitting an assertion, making it easier to find the root cause of such errors.
> 
> Please note that RTE_ASSERTs are omitted unless built with RTE_ENABLE_ASSERT, so this assertion is omitted and thus has no
> performance impact for a normal build.

I am aware that RTE_ASSERT is not enabled by default.
My question was more about - why do you feel assert() is necessary in that case in particular.
Does it guard for some specific scenario or so.
Anyway, I am ok either way: with and without assert() here.
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com> 


  reply	other threads:[~2022-12-23 16:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 10:18 [PATCH] " Morten Brørup
2022-11-16 11:04 ` Andrew Rybchenko
2022-11-16 11:10   ` Morten Brørup
2022-11-16 11:29     ` Andrew Rybchenko
2022-11-16 12:14 ` [PATCH v2] " Morten Brørup
2022-11-16 15:51   ` Honnappa Nagarahalli
2022-11-16 15:59     ` Morten Brørup
2022-11-16 16:26       ` Honnappa Nagarahalli
2022-11-16 17:39         ` Morten Brørup
2022-12-19  8:50           ` Morten Brørup
2022-12-22 13:52             ` Konstantin Ananyev
2022-12-22 15:02               ` Morten Brørup
2022-12-23 16:34                 ` Konstantin Ananyev [this message]
2022-12-24 10:46 ` [PATCH v3] " Morten Brørup
2022-12-27  8:54   ` Andrew Rybchenko
2022-12-27 15:37     ` Morten Brørup

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=b69b8a25d51b44d6ac46482d47354f05@huawei.com \
    --to=konstantin.ananyev@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=mb@smartsharesystems.com \
    --cc=nd@arm.com \
    --cc=olivier.matz@6wind.com \
    --cc=thomas@monjalon.net \
    /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).