lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANqkERCQixuCe9vfeDncHikED-bVwZ3APr=mo6WfQBcGf4rz_g@mail.gmail.com>
Date:	Mon, 7 May 2012 15:13:33 -0700
From:	Brian Swetland <swetland@...gle.com>
To:	Tim Bird <tim.bird@...sony.com>
Cc:	Greg KH <gregkh@...uxfoundation.org>,
	linux kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: android: logger: Allocate logs dynamically at boot

On Mon, May 7, 2012 at 11:50 AM, Tim Bird <tim.bird@...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).

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ