From: Andrew Morton <akpm@osdl.org>
To: Armin Schindler <armin@melware.de>
Cc: linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH 2.6] serialization of kernelcapi work
Date: Thu, 18 Mar 2004 12:18:26 -0800 [thread overview]
Message-ID: <20040318121826.61c9f145.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.31.0403181117350.10499-100000@phoenix.one.melware.de>
Armin Schindler <armin@melware.de> wrote:
>
> Hi all,
>
> the ISDN kernelcapi function recv_handler() is triggered by
> schedule_work() and dispatches the CAPI messages to the applications.
>
> Since a workqueue function may run on another CPU at the same time,
> reordering of CAPI messages may occur.
TCP has the same problem.
> For serialization I suggest a mutex semaphore in recv_handler(),
> patch is appended (yet untested).
It will work OK. It isn't very scalable of course, but I assume you're
dealing with relatively low bandwidths.
I would suggest that you look at avoiding the global semaphore. Suppose
someone has 64 interfaces or something. Is that possible? It might be
better to put the semaphore into struct capi_ctr so you can at least
process frames from separate cards in parallel.
> Is there a better way to do user-context work serialized ?
Not really - you've been bitten by the compulsory per-cpuness of the
workqueue handlers.
You could have a standalone kernel thread or always queue the work onto CPU
#0 (the function to do this isn't merged, but exists). But both these are
unscalable.
So apart from moving recv_handler_lock into struct capi_ctr I can't think
of anything clever.
next prev parent reply other threads:[~2004-03-18 20:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-18 10:53 Armin Schindler
2004-03-18 20:18 ` Andrew Morton [this message]
2004-03-18 20:37 ` Armin Schindler
2004-03-20 10:53 ` Armin Schindler
2004-03-20 19:14 ` Andrew Morton
2004-03-20 20:15 ` Armin Schindler
2004-03-20 21:05 ` Andrew Morton
2004-03-20 22:20 ` Armin Schindler
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=20040318121826.61c9f145.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=armin@melware.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®