Re: PATCH: report NGROUPS_MAX via a sysctl (read-only)

From: Glen Turner (glen.turner_at_aarnet.edu.au)
Date: 02/25/04

  • Next message: Jeff Garzik: "Re: [PATCH 403] Amiga A2065 Ethernet new driver model"
    To: Tim Hockin <thockin@hockin.org>
    Date:	Wed, 25 Feb 2004 11:29:27 +1030
    
    

    On Fri, 2004-02-20 at 17:40, Tim Hockin wrote:

    > Well, really I don't see how apps would want to use it in any way that was
    > correct.

    The mere existence of the value means it can be used correctly
    in application code for sanity checking.

    eg:
       assert(list_length(group_list) < ngroups_max());
       list_append(&group_list, group);

    An application might also use it to automatically
    size data structure details, such as the parameters of
    a hash function.

      h = hash_create(ngroups_max());

    Returning INT_MAX for NGROUPS_MAX isn't wrong, but you
    then can't blame user space for making inefficient choices
    if the kernel limit is actually smaller.

    Cheers,
    Glen

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


  • Next message: Jeff Garzik: "Re: [PATCH 403] Amiga A2065 Ethernet new driver model"

    Relevant Pages

    • Re: PATCH - raise max_anon limit
      ... >> a) realloc the bitmap when it fills up ... This can work if it's OK to allocate pages during set_max_anon(which ... Tim Hockin ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • PATCH - raise max_anon limit
      ... sysctl allows the admin to set the order of pages allocated for the unnamed ... Tim Hockin ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] 2.6.1-rc2 ide barrier support
      ... would you care to review the ide bits for sanity? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] kfree_skb() bug in 2.4.22
      ... > and vfreeand they have a sanity check for NULL before processing, ... > well as those are also the well-known semantics for the userspace free ... Passing NULL pointers around usually indicates poorly designed ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] v4l: bttv update
      ... It also added sanity checks for the bt878 risc ... > code buffer sizes, adds support for a new tv card and has some minor ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)