From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH 4/4] mark pseudo users as deleted instead of removing them
Date: Fri, 4 Aug 2017 23:34:16 +0200 [thread overview]
Message-ID: <CAExDi1T5kFzPi6XJCeDabP3wY+HgF39QQvsfTgN8uQLNUnaZLQ@mail.gmail.com> (raw)
In-Reply-To: <CANeU7QmVn0wd-JJc4MPhDPK+QLP-DgsbKNm2sHF-QAmG8kR12Q@mail.gmail.com>
On Fri, Aug 4, 2017 at 11:14 PM, Christopher Li <sparse@chrisli.org> wrote:
> On Fri, Aug 4, 2017 at 5:03 PM, Luc Van Oostenryck wrote:
>>> I am not sure we are on the same page. Only 2 macro need to be updated:
>>> DO_FOR_EACH_PTR, DO_FOR_EACH_REVERSE.
>>
>> It's not for the number of macros defined.
>> It's about the code size & the run-time effect on the iteration of
>> the other lists. It seems simple enough but it would add two load-test-branch
>
> Because the rm is near the nr, which get visit every loop iteration.
> From cache line point of view, the ptrlist->rm will not cause extra cache load.
> The second test and load will not matter for most of the ptrlist any way.
Yes, we agree.
> I am willing to bet even my test-ptrlist benchmark will not see much a
> difference.
It will depend on how micro the benchmark is but indeed on real code,
most probably it won't make any measurable difference.
>> to every such macro invocation and these macros are already quite heavy.
>
> The flip side is if some one forget to check that, it will be very
> bad. How do you
> make sure you add the check to every single one of the loop iterator?
Oh, I agree on this one but the same argument when pushed further
can lead to absurd situations. We're not there though.
> I can take patch as it is. It is only a suggestion. No deal breaker.
Frankly, I don't know.
I never liked to have to add these checks a bit everywhere,
that's why I called it 'not very pretty'.
My inclination would be to create a variant FOR_EACH_PTR_NULL(),
this can be done without duplicating the real macro DO_...
but then you can as easily forgot to call this variant that you could
forgot to add the test locally (adding some typing could help here though).
On the other hand, adding these tests to all list iteration code when
not needed looks bad.
OK, since the run-time impact will be low enough let's choose the
solution with the smallest (source) code impact.
New version on the way.
-- Luc
next prev parent reply other threads:[~2017-08-04 21:34 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 15:32 [PATCH RFC] Let pseudo->users loop on duplicate version of list Christopher Li
2017-07-11 20:53 ` Christopher Li
2017-07-11 21:04 ` Dibyendu Majumdar
2017-07-12 5:29 ` Christopher Li
2017-07-12 15:56 ` Dibyendu Majumdar
2017-07-12 17:03 ` Christopher Li
2017-07-12 18:05 ` Dibyendu Majumdar
2017-07-13 5:27 ` Christopher Li
2017-07-19 21:14 ` Luc Van Oostenryck
2017-07-19 21:42 ` Christopher Li
2017-07-19 22:51 ` Luc Van Oostenryck
2017-07-20 2:34 ` Christopher Li
2017-08-02 23:44 ` Luc Van Oostenryck
2017-08-03 0:50 ` Christopher Li
2017-08-03 10:18 ` Luc Van Oostenryck
2017-08-03 23:48 ` Christopher Li
2017-08-04 0:41 ` Luc Van Oostenryck
2017-08-04 2:22 ` Christopher Li
2017-08-04 10:38 ` Luc Van Oostenryck
2017-08-04 14:48 ` Christopher Li
2017-08-04 16:58 ` Luc Van Oostenryck
[not found] ` <20170804002230.5047-1-luc.vanoostenryck@gmail.com>
2017-08-04 14:54 ` Fwd: [PATCH] mark pseudo user as deleted instead of removing them Christopher Li
2017-08-04 15:29 ` Christopher Li
2017-08-04 15:58 ` Luc Van Oostenryck
2017-08-04 18:19 ` Christopher Li
2017-08-04 19:12 ` Luc Van Oostenryck
2017-08-04 19:24 ` Christopher Li
2017-08-04 20:09 ` [PATCH 0/4] fix list corruption with recursive remove_usage() Luc Van Oostenryck
2017-08-04 20:09 ` [PATCH 1/4] ptrlist: add a counter for the number of removed elemnets Luc Van Oostenryck
2017-08-04 20:09 ` [PATCH 2/4] ptrlist: adjust ptr_list_size for the new ->rm field Luc Van Oostenryck
2017-08-04 20:09 ` [PATCH 3/4] ptrlist: add MARK_CURRENT_DELETED Luc Van Oostenryck
2017-08-04 20:09 ` [PATCH 4/4] mark pseudo users as deleted instead of removing them Luc Van Oostenryck
2017-08-04 20:17 ` Christopher Li
2017-08-04 20:18 ` Christopher Li
2017-08-04 20:34 ` Luc Van Oostenryck
2017-08-04 20:48 ` Christopher Li
2017-08-04 21:03 ` Luc Van Oostenryck
2017-08-04 21:14 ` Christopher Li
2017-08-04 21:34 ` Luc Van Oostenryck [this message]
2017-08-04 16:54 ` [PATCH] mark pseudo user " Linus Torvalds
2017-08-04 18:33 ` Christopher Li
2017-08-04 20:08 ` Christopher Li
2017-08-04 20:37 ` Christopher Li
2017-07-13 12:23 ` [PATCH RFC] Let pseudo->users loop on duplicate version of list Christopher Li
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=CAExDi1T5kFzPi6XJCeDabP3wY+HgF39QQvsfTgN8uQLNUnaZLQ@mail.gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/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).