public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Bird <tim.bird@am.sony.com>
To: Brian Swetland <swetland@google.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: android: logger: Allocate logs dynamically at boot
Date: Mon, 7 May 2012 16:40:13 -0700	[thread overview]
Message-ID: <4FA85D5D.2070103@am.sony.com> (raw)
In-Reply-To: <CANqkERCQixuCe9vfeDncHikED-bVwZ3APr=mo6WfQBcGf4rz_g@mail.gmail.com>

On 05/07/2012 03:13 PM, Brian Swetland wrote:
> On Mon, May 7, 2012 at 11:50 AM, Tim Bird <tim.bird@am.sony.com> wrote:
>> On 05/04/2012 04:37 PM, Greg KH wrote:
>>> On Fri, May 04, 2012 at 04:33:16PM -0700, Tim Bird wrote:
>>>> +#define MAX_LOGS    5
>>>> +struct logger_log *logs_array[MAX_LOGS];
>>>
>>> You are going to make this a list and not a static array in the
>>> future, right?
>>
>> Would that be better?  The for-loop is IMHO simpler than a
>> list walk for finding matches.  I anticipate that the size of
>> this array should never (famous last words) be bigger than about
>> 20 entries, even in the dynamic-allocation-per-application
>> case.  And that's a ways off in implementation.
>>
>> I'll be happy to switch to a linked list once it looks like we're
>> going to have more than 5 entries.  Or I can switch to a linked
>> list now if you think it's better form to code for the longer-term
>> anticipated features.
>>
>> Not a big deal to me either way.
> 
> I'd also favor a list approach. It won't break unexpectedly when
> somebody inevitably adds that 6th log or whatever, and the list
> traversal cost only occurs during open(), which is not a frequent
> operation -- most users keep the log driver open for the process
> lifespan (both readers and writers).

OK - I'll convert to a list and send an updated patch soon.
 -- Tim


=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation
Senior Staff Engineer, Sony Network Entertainment
=============================


      reply	other threads:[~2012-05-07 23:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 23:33 [PATCH] staging: android: logger: Allocate logs dynamically at boot Tim Bird
2012-05-04 23:37 ` Greg KH
2012-05-07 18:50   ` Tim Bird
2012-05-07 18:58     ` Greg KH
2012-05-07 19:14       ` Tim Bird
2012-05-07 19:56         ` Greg KH
2012-05-07 22:13     ` Brian Swetland
2012-05-07 23:40       ` Tim Bird [this message]

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=4FA85D5D.2070103@am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swetland@google.com \
    /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