mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keyoor Khristi <keyoor.khristi@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Issue with netlink implementation
Date: Sat, 4 Apr 2009 02:54:48 +0530	[thread overview]
Message-ID: <6b4fbcea0904031424j4b1f5526ydd1d21307e511273@mail.gmail.com> (raw)
In-Reply-To: <6b4fbcea0904030921j1b627d3ar37af13a0788706b4@mail.gmail.com>

Hi All,

We are facing an issue with netlink implementation. We are sending the
data from user space to kernel space. a kernel thread gets the data
from netlink socket (via skb_recv_datagram). After doing little bit
processing we give the skb to driver. driver sends the data and frees
the skb. Sometimes we observe that the writer thread in userspace gets
stuck writing a packet and doesnt come out. We traced the problem to
netlink_attachskb. When a packet is sent on the netlink socket
netlink_attachskb is called to add the skb to the queue. when there is
not enough space, the thread is added to nlk->wait queue and issues
schedule_timeout. it doesnt come out of it as no other thread awakens
it. It seems when the driver frees the skb, the data is freed and the
receive space is made available in the destructor but the thread
waiting is not awaken. This is causing the problem we're seeing.
I think the netlink implementation in af_netlink.c can be enhanced. In
netlink_attachskb, after invoking skb_set_owner_r we should change the
skb->destructor to point to newly added function netlink_rfree. When
skb is freed, netlink_rfree function can issue sock_rfree and awaken
the threads waiting on nlk->wait queue.

Please let me know what you think about it.
I'm not sure if i've sent the email to correct forum. If i should be
sending to another forum, please tell me.

Regards,
K

       reply	other threads:[~2009-04-03 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6b4fbcea0904030921j1b627d3ar37af13a0788706b4@mail.gmail.com>
2009-04-03 21:24 ` Keyoor Khristi [this message]
2009-04-04  5:06   ` David Miller
2009-04-04  9:33     ` Patrick McHardy

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=6b4fbcea0904031424j4b1f5526ydd1d21307e511273@mail.gmail.com \
    --to=keyoor.khristi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®