mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: No buffer space available??
       [not found] <01020512555302.10576@therver.local2.lan>
@ 2001-02-05 19:03 ` Dan Kegel
  0 siblings, 0 replies; only message in thread
From: Dan Kegel @ 2001-02-05 19:03 UTC (permalink / raw)
  To: mathieu_dube, linux-kernel

Mathieu Dube wrote:
>         when accept return -1 perror gives me "No buffer space available"
> What do you think that means??

Better ask a real net guru :-) 
Or look at the sources.

in /usr/src/linux/net/ipv4/af_inet.c

int inet_create() {
    ...
    sk = sk_alloc(PF_INET, GFP_KERNEL, 1);   
    if (sk == NULL)
        goto do_oom;  
    ...
    do_oom:
        return -ENOBUFS;   

in /usr/src/linux/net/core/sock.c

/*
 *  All socket objects are allocated here. This is for future
 *  usage.
 */
 
struct sock *sk_alloc(int family, int priority, int zero_it)
{
    struct sock *sk = kmem_cache_alloc(sk_cachep, priority);
 
    if(sk) {
        if (zero_it)
            memset(sk, 0, sizeof(struct sock));
        sk->family = family;
    }
 
    return sk;
}    

void __init sk_init(void)
{
    sk_cachep = kmem_cache_create("sock", sizeof(struct sock), 0,
                      SLAB_HWCACHE_ALIGN, 0, 0);
 
}     

Poking around a little in mm/slab.c, I see that the name passed to
kmem_cache_create is used in generating the /proc/slabinfo report, so 
  cat /proc/slabinfo   | grep sock
shows you some info.  On my system, it prints two numbers, from
        len += sprintf(buf+len, "%-17s %6lu %6lu\n", cachep->c_name, active_objs, num_objs);  
which tells you how many sockets are allocated.  Dunno how useful that is.

Like I said, you'll have to ask a real guru :-)

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-02-05 19:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <01020512555302.10576@therver.local2.lan>
2001-02-05 19:03 ` No buffer space available?? Dan Kegel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®