mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Kegel <dank@alumni.caltech.edu>
To: mathieu_dube@videotron.ca, linux-kernel@vger.kernel.org
Subject: Re: No buffer space available??
Date: Mon, 05 Feb 2001 11:03:26 -0800	[thread overview]
Message-ID: <3A7EF8FE.6169BB52@alumni.caltech.edu> (raw)
In-Reply-To: <01020512555302.10576@therver.local2.lan>

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/

           reply	other threads:[~2001-02-05 19:02 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <01020512555302.10576@therver.local2.lan>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A7EF8FE.6169BB52@alumni.caltech.edu \
    --to=dank@alumni.caltech.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu_dube@videotron.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®