public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: paulmck@linux.vnet.ibm.com, dipankar@in.ibm.com,
	mingo@kernel.org, hpa@zytor.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, peter.senna@gmail.com
Subject: Re: [RFC] hlist: drop the node parameter from iterators
Date: Thu, 01 Nov 2012 22:26:54 -0400	[thread overview]
Message-ID: <50932F6E.5060506@oracle.com> (raw)
In-Reply-To: <CA+55aFxxdFCiOHEz_xWx1vjMkpQzab_Mdmd2dweknayhVBx6kA@mail.gmail.com>

On 11/01/2012 08:59 PM, Linus Torvalds wrote:
> On Thu, Nov 1, 2012 at 4:06 PM, Sasha Levin <sasha.levin@oracle.com> wrote:
>> I'm not sure why, but the hlist for each entry iterators were conceived
>> differently from the list ones. While the list ones are nice and elegant:
>>
>>         list_for_each_entry(pos, head, member)
>>
>> The hlist ones were greedy and wanted an extra parameter:
>>
>>         hlist_for_each_entry(tpos, pos, head, member)
>>
>> Why did they need an extra pos parameter? I'm not quite sure. Not only
>> they don't really need it, it also prevents the iterator from looking
>> exactly like the list iterator, which is unfortunate.
>>
>> [..]
>>  170 files changed, 481 insertions(+), 879 deletions(-)
>>
>> Yes, beyond making hlist prettier, we also drop 400 lines. win-win?
> 
> So this has been discussed before, and one of the problems with this
> is just the pain of maintenance. This tends to cause annoyances for
> merging, but also for -stable backporting etc, because it just results
> in a lot of noise.
> 
> Now, the hlist_for_each() case isn't used by quite as many sites as
> some of the others helpers like this, so maybe the pain isn't horribly
> bad, but in general I do tend to get nervous about "let's clean it up"
> when it touches hundreds of files.
> 
> Your thing looks nice in that it has the coccinelle script (which
> hopefully means that we really get them all), but just out of
> interest, how different is the patch after running the script on both
> 
>  (a) my current -git head
>  (b) linux-next
> 
> because differences (other than just line numbers) imply conflicts.
> How many differences are we talking about? None? Two? Twenty?
> 
> (That said, right now linux-next is tiny. It might be more interesting
> to look at the linux-3.5 vs linux-3.6 to get more of a feel for
> differences between releases. Doing just the diff+grep thing, there's
> quite a few changes around hlist_for_each_entry() uses)

Instead of diffing diffs, I've just tried applying different versions
of the patch of different trees, and then looking at how many conflicts
happen as a result of that. I think it's probably a good indication of
how many conflicts this change would really cause.

Here are some stats:

 - Applying the patch from -next on top of your current git head
results in 3 conflicts.

 - Applying the patch from your current git head on top of v3.6 results
in 18 conflicts.

 - Applying the patch from 3.6 on top of 3.5 results in 25 conflicts.



Thanks,
Sasha


  reply	other threads:[~2012-11-02  2:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 23:06 [RFC] hlist: drop the node parameter from iterators Sasha Levin
2012-11-02  0:59 ` Linus Torvalds
2012-11-02  2:26   ` Sasha Levin [this message]
2012-11-02 20:16     ` Linus Torvalds
2012-11-02 20:31       ` Peter Senna Tschudin
2012-11-02 20:33       ` Sasha Levin
2012-11-02 20:39         ` Linus Torvalds

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=50932F6E.5060506@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dipankar@in.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peter.senna@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox