From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 0/2] be more generous with ptrlist repacking
Date: Thu, 17 Nov 2016 18:25:57 +0100 [thread overview]
Message-ID: <20161117172559.29417-1-luc.vanoostenryck@gmail.com> (raw)
The macros that do the ptrlist walking don't handle empty blocks.
So, when some elements are removed from a list some list rapacking
need to be done to remove the empty blocks. Failure to do this
can result in crashes or data corruption.
This series aims to improve the situation by:
- doing the repacking at the places where some elements are removed
but no repacking where done.
- to compensate the added cost, mark ptrlists as dirty when some
element are removed from it and only do the repacking when the list
is marked as dirty.
Another thing that can be done would be to check the dirty bit at every
list walking but I think this should be reserved for testing/debugging.
In fact, while at first agreeing with the idea of the second patch,
I think less and less that it's the right approach.
What are we looking after here?
* Performance?
- Will this bit save us a lot of list repacking?
* Robustness?
- What this bit bring us? Nothing without check at each list walking.
Is it a good idea to sprinkle some assert() on the macros?
- I would much prefer to have something that either:
- can do the list walking with empty blocks, or
- never leave any empty blocks.
and this without making the macros heavier :)
I'll try later to propose something but for now ...
Luc Van Oostenryck (2):
add missing PACK_PTR_LIST()
mark lists to be repacked as dirty
cse.c | 1 +
evaluate.c | 1 +
ptrlist.c | 7 +++++++
ptrlist.h | 4 +++-
4 files changed, 12 insertions(+), 1 deletion(-)
--
next reply other threads:[~2016-11-17 17:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 17:25 Luc Van Oostenryck [this message]
2016-11-17 17:25 ` [PATCH 1/2] add missing PACK_PTR_LIST() Luc Van Oostenryck
2016-11-17 17:25 ` [PATCH 2/2] mark lists to be repacked as dirty Luc Van Oostenryck
2016-11-17 17:40 ` [PATCH 0/2] be more generous with ptrlist repacking Linus Torvalds
2016-11-17 18:17 ` Christopher Li
2016-11-17 20:25 ` Luc Van Oostenryck
2016-11-17 22:03 ` Linus Torvalds
2016-11-18 0:29 ` Luc Van Oostenryck
2016-11-28 21:15 ` Luc Van Oostenryck
2016-12-06 0:24 ` Christopher Li
2016-11-18 12:26 ` Luc Van Oostenryck
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=20161117172559.29417-1-luc.vanoostenryck@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).