Re: [PATCH] remove sysfs attr_list

2016-02-29 Thread Hannes Reinecke
On 02/29/2016 10:58 PM, Bart Van Assche wrote:
> On 02/28/16 23:59, Hannes Reinecke wrote:
>> libudev has a _massive_ static memory footprint
>> (Kay doesn't believe in memory allocation).
>> So when using libudev you might end up having a really large memory
>> footprint due to all the on-stack allocations in there.
>> Be especially careful when attempting to use pthreads; debugging stack
>> overflow in pthreads is no fun whatsoever.
> 
> That's exactly the reason why I never allocate large data structures on
> the stack in applications I write myself and why I use dynamic memory
> allocation for large data structures. To make sure that such large stack
> allocations get detected I set the stack size to a low value:
> 
>   pthread_attr_t attr;
>   pthread_attr_init();
>   pthread_attr_setstacksize(, PTHREAD_STACK_MIN);
>   pthread_create(..., , ..., ...);
> 
Oh, I don't need to detect them.
I know exactly where they are. But precisely that is a design goal of
the libudev code, so any patches trying to fix that up will be discarded
out-of-hand :-(

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] remove sysfs attr_list

2016-02-29 Thread Chris Leech
On Wed, Feb 17, 2016 at 03:01:36PM -0800, Chris Leech wrote:
> The global cache is not well designed, it quickly can grow to the point
> where lookups take much longer than just doing the sysfs read in the
> first place.

This patch has problems, the sysfs_attr_get_value changes are wrong when
attempting to read an attribute that doesn't exist.  It returns the
result of calling strdup on random stack data, I'm not sure what I was
thinking.

Better version soon.

- Chris

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] remove sysfs attr_list

2016-02-29 Thread Bart Van Assche

On 02/28/16 23:59, Hannes Reinecke wrote:

libudev has a _massive_ static memory footprint
(Kay doesn't believe in memory allocation).
So when using libudev you might end up having a really large memory
footprint due to all the on-stack allocations in there.
Be especially careful when attempting to use pthreads; debugging stack
overflow in pthreads is no fun whatsoever.


That's exactly the reason why I never allocate large data structures on 
the stack in applications I write myself and why I use dynamic memory 
allocation for large data structures. To make sure that such large stack 
allocations get detected I set the stack size to a low value:


  pthread_attr_t attr;
  pthread_attr_init();
  pthread_attr_setstacksize(, PTHREAD_STACK_MIN);
  pthread_create(..., , ..., ...);

Bart.

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.