From: David Miller <davem@davemloft.net>
To: nhorman@tuxdriver.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] drop_monitor: prevent init path from scheduling on the wrong cpu
Date: Wed, 02 May 2012 21:02:58 -0400 (EDT) [thread overview]
Message-ID: <20120502.210258.1086419954037969029.davem@davemloft.net> (raw)
In-Reply-To: <1335896282-11738-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Tue, 1 May 2012 14:18:02 -0400
> I just noticed after some recent updates, that the init path for the drop
> monitor protocol has a minor error. drop monitor maintains a per cpu structure,
> that gets initalized from a single cpu. Normally this is fine, as the protocol
> isn't in use yet, but I recently made a change that causes a failed skb
> allocation to reschedule itself . Given the current code, the implication is
> that this workqueue reschedule will take place on the wrong cpu. If drop
> monitor is used early during the boot process, its possible that two cpus will
> access a single per-cpu structure in parallel, possibly leading to data
> corruption.
>
> This patch fixes the situation, by storing the cpu number that a given instance
> of this per-cpu data should be accessed from. In the case of a need for a
> reschedule, the cpu stored in the struct is assigned the rescheule, rather than
> the currently executing cpu
>
> Tested successfully by myself.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Applied, thanks Neil.
prev parent reply other threads:[~2012-05-03 1:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 18:18 [PATCH] drop_monitor: prevent init path from scheduling on the wrong cpu Neil Horman
2012-05-03 1:02 ` David Miller [this message]
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=20120502.210258.1086419954037969029.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
/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;
as well as URLs for NNTP newsgroup(s).