From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org, davem@davemloft.com, matthew@wil.cx
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
dhowells@redhat.com
Subject: [PATCH 2/2] WorkStruct: Use bitops-safe direct assignment
Date: Tue, 12 Dec 2006 20:11:17 +0000 [thread overview]
Message-ID: <20061212201117.29817.23933.stgit@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <20061212201112.29817.22041.stgit@warthog.cambridge.redhat.com>
Replace the direct assignment in set_wq_data() with a bitops-proofed wrapper
(assign_bits()). This defends against the test_and_set_bit() used to mark a
work item active.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
kernel/workqueue.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index db49886..f5e9540 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -97,7 +97,7 @@ static inline void set_wq_data(struct wo
new = (unsigned long) wq | (1UL << WORK_STRUCT_PENDING);
new |= work->management & WORK_STRUCT_FLAG_MASK;
- work->management = new;
+ assign_bits(new, &work->management);
}
static inline void *get_wq_data(struct work_struct *work)
next prev parent reply other threads:[~2006-12-12 20:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-12 20:11 [PATCH 1/2] WorkStruct: Add assign_bits() to give an atomic-bitops safe assignment David Howells
2006-12-12 20:11 ` David Howells [this message]
2006-12-12 22:54 ` Russell King
2006-12-12 23:03 ` Paul Mackerras
2006-12-12 23:17 ` David Howells
2006-12-13 1:36 ` Linus Torvalds
2006-12-13 2:07 ` Nick Piggin
2006-12-13 2:30 ` Linus Torvalds
2006-12-15 22:45 ` Linus Torvalds
2006-12-18 8:56 ` David Woodhouse
2006-12-18 9:05 ` Evgeniy Polyakov
2006-12-18 9:10 ` David Miller
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=20061212201117.29817.23933.stgit@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=davem@davemloft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--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