All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Gaurav Minocha
	<gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Herring <rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] Patch to improve device tree structure
Date: Wed, 19 Nov 2014 13:56:38 +0000	[thread overview]
Message-ID: <CACxGe6u1YwQAivktwmiOZx1K1Ch0F1ofx3EriBi1qEAU99X9PQ@mail.gmail.com> (raw)
In-Reply-To: <546BF447.6080300-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Wed, Nov 19, 2014 at 1:37 AM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 11/18/2014 7:10 AM, Grant Likely wrote:
>> On Sun, 16 Nov 2014 20:52:56 -0800
>> , Gaurav Minocha <gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>  wrote:
>>> This patch improves the implementation of device tree structure.
>>>
>>> Traditional child and sibling linked list in device tree structure
>>> is removed and is replaced by list_head (i.e. circular doubly linked
>>>  list) already available in Linux kernel.
>>>
>>> Signed-off-by: Gaurav Minocha <gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>> Hi Gaurav,
>>
>> So, after you've done this work, I need to you rebase it (and of course
>> it is non-trivial) onto linux-next. I've already got a patch queued up
>> which gets rid of the of_allnodes/allnext list which will have conflicts
>> with this patch.
>>
>> I'll make comments below where still relevant.
>
> Grant,
>
> My first reaction to this patch was that moving to using struct list_head
> made the code less readable plus increased the size of struct device_node.
>
> I reworked the changes to drivers/of/base.c to see if I could make
> it a little more readable.  And I see below that you also have some
> suggestions that make it more readable.
>
> Even after that, I'm still feeling that the gain of moving to a more
> standard list data type might not be greater than the downsides in
> terms of readability and space.  The current list implementation does
> seem like a decent fit to the problem space.

Moving to list_head has a couple of nice benefits. The prime
motification is that using a standard list_head means that the OF code
can be migrated to use the standard rcu operations and get rid of manual
of_node_{get,put} management in the majority of code paths.

A second reason to do this is it becomes easy to add nodes to the end of
the list instead of the beginning. It's a small thing, but it makes
unflattening simpler.

I've also considered switching to a hlist_head/hlist_node to keep the
footprint the same.* With an hlist_head the cost is a wash, but looses
the ability to do O(1) addition to the end of the list.

* Gaurav's patch removes the *child and *sibling pointers, but doesn't
  remove the *next pointer which can also be dropped. So, three pointers
  get dropped from the structure. Using list_head adds 4 pointers (Net
  +1). hlist_head adds 3 (Net 0).

g.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-11-19 13:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  4:52 [PATCH] Patch to improve device tree structure Gaurav Minocha
     [not found] ` <1416199976-21147-1-git-send-email-gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-18  1:57   ` Frank Rowand
2014-11-18 15:10   ` Grant Likely
     [not found]     ` <20141118151026.D2D63C40966-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-11-19  1:37       ` Frank Rowand
     [not found]         ` <546BF447.6080300-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-19 13:56           ` Grant Likely [this message]
     [not found]             ` <CACxGe6u1YwQAivktwmiOZx1K1Ch0F1ofx3EriBi1qEAU99X9PQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-19 19:30               ` Frank Rowand
     [not found]                 ` <546CEFC4.805-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-19 20:03                   ` Frank Rowand
     [not found]                     ` <546CF7AD.8060707-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-19 20:05                       ` Frank Rowand
2014-11-28 16:48                   ` Grant Likely
     [not found]                     ` <20141128164829.CC876C40884-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-12-03  3:39                       ` Frank Rowand
     [not found]                         ` <547E85DF.5000200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-03 15:09                           ` Grant Likely
     [not found]                             ` <CACxGe6v-=nWamWbbe0EBk_X5D1M3LSo_CZ_w95NSVS5jcio=NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-03 19:42                               ` Frank Rowand
2014-11-24  1:22       ` Gaurav Minocha
     [not found]         ` <CA+rpMbKZvMb4uxSFabvXG5nRNQnNXnAKUhdjn0Vp_wZBFN8COw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-28  3:59           ` Gaurav Minocha
2014-11-28 15:46           ` Grant Likely

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=CACxGe6u1YwQAivktwmiOZx1K1Ch0F1ofx3EriBi1qEAU99X9PQ@mail.gmail.com \
    --to=grant.likely-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gaurav.minocha.os-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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.