Re: sdirno type?

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Thu, 4 Oct 2001 21:23:53 +0200

On 4 Oct 2001, at 20:50, Henrik Nordstrom <hno@squid-cache.org> wrote:

> Adrian Chadd wrote:
>
> > I've run my private test squids with the sdirno set to a char
> > rather than an int. Things seem to run quite fine with the patch.
> > Now, the storeentry has got an explicit bit size but I still
> > think it'll be a good thing to get out of the way now.
> >
> > What do people think?
>
> I have expressed my opinion before. Still share the same view.
>
> Any change that further increases the size of StoreEntry modulo 4 on
> Intel or Alpha is banned from Suqid-2.5. Period. For the next cycle of
> HEAD such changes is fine.
>
> The size of the sdirno field is purely a exercise in memory usage. From
> a stability point of view there is very little to say except that parts
> of the code may expect it to be signed so a unqualified char type is
> most likely a bad choice.

struct _StoreEntry {
    hash_link hash; /* must be first */
    MemObject *mem_obj;
    RemovalPolicyNode repl;
    time_t timestamp;
    time_t lastref;
    time_t expires;
    time_t lastmod;
    size_t swap_file_sz;
- sfileno swap_filen:25;
- sdirno swap_dirn:7;
+ sfileno swap_filen;
    u_short refcount;
    u_short flags;
    u_short lock_count; /* Assume < 65536! */
+ sdirno swap_dirn:4;
    mem_status_t mem_status:3;
    ping_status_t ping_status:3;
    store_status_t store_status:3;
    swap_status_t swap_status:3;
};

 Such layout keeps us at 48 bytes/sentry, the only limitation is
 max 16 sdirs. Is it acceptable compromise?
 I wonder how many people need more than that number of sdirs?
 Perhaps make this compiletime option. I understand that 32bit
 sfileno is currently requirement for using coss best.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 CTO, Microlink Online
 Tel: 6501 731, Fax: 6501 725
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Thu Oct 04 2001 - 13:30:44 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:26 MST