All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Dibyendu Majumdar <mobile@majumdar.org.uk>,
	Linux-Sparse <linux-sparse@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH RFC] Let pseudo->users loop on duplicate version of list
Date: Thu, 20 Jul 2017 00:51:00 +0200	[thread overview]
Message-ID: <CAMHZB6E9LkHc4KR5ktoS2MzZpZpW09h4_U8XH+PVE4HTmi1LcQ@mail.gmail.com> (raw)
In-Reply-To: <CANeU7QmQ4JmD_wLoZ6r7bV7Uu4BASnvuHpmQ7VKAoZXR9FD93w@mail.gmail.com>

On Wed, Jul 19, 2017 at 11:42 PM, Christopher Li <sparse@chrisli.org> wrote:
> On Wed, Jul 19, 2017 at 2:14 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>> When I see this description, the first thing I think is:
>> "you have a problem with an object, you duplicate the object,
>>  not you have two problem (at least)".
>> In short, how you will keep coherency between the two?
>
> We don't :-). Both the remove case and insert case has been
> discussed. First of all, the ptrlist-refcount patch check for the
> insert case, there is none so far. If you believe there is one,
> I would like to know.

Some add_user() can be called in this loop. so it's just a question
to some input code complex enough to have an add_user()
done on the same pseudo as the one concerned in the outer
loop.

> About the looping on the deleted entry. That is the very first
> thing I shout in the V1 version of the patch. The thing is,
> the pseudo_user have a point to instruction. If the instruction
> is deleted then that instruction will have insn->bb = NULL.
>
> Not a perfect fix. But better than the previous. Because
> the for loop is actually looping on reverse order. Any delete
> will cause major align problem __nr counting from the tail.

Yes, those list delete inside iteration loops are definitively to avoid.

> Any way, My V1 and email asking for suggestion how to fix it
> About 10 days  ago. I haven't heard any thing better. If you
> have other way to fix it properly, I am all for it. It is not too late
> but time is running out soon.

I stated several times that the only real solution will be to mark the
elements as being deleted (and only effectively delete them in some
safe situations) exactly like it is done for instruction (which are probably
the type the most often deleted from lists. Trying to effectively
removing them from lists like it is currently done for the others types
would most probably fail in the most horrible ways).
It's a simple & clean solution, provably correct in *all* situations.
But I don't remember having seen any replies from you on this subject.

-- Luc

  reply	other threads:[~2017-07-19 22:51 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 [this message]
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
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=CAMHZB6E9LkHc4KR5ktoS2MzZpZpW09h4_U8XH+PVE4HTmi1LcQ@mail.gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=mobile@majumdar.org.uk \
    --cc=sparse@chrisli.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.