diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-18 19:44:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-18 19:44:24 -0500 |
commit | a200dcb34693084e56496960d855afdeaaf9578f (patch) | |
tree | bf65e4350460b7f98247278469f7600d1808c3fc /scripts | |
parent | d05d82f7110b08fd36178a641b69a1f206e1142b (diff) | |
parent | 43e361f23c49dbddf74f56ddf6cdd85c5dbff6da (diff) |
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio barrier rework+fixes from Michael Tsirkin:
"This adds a new kind of barrier, and reworks virtio and xen to use it.
Plus some fixes here and there"
* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (44 commits)
checkpatch: add virt barriers
checkpatch: check for __smp outside barrier.h
checkpatch.pl: add missing memory barriers
virtio: make find_vqs() checkpatch.pl-friendly
virtio_balloon: fix race between migration and ballooning
virtio_balloon: fix race by fill and leak
s390: more efficient smp barriers
s390: use generic memory barriers
xen/events: use virt_xxx barriers
xen/io: use virt_xxx barriers
xenbus: use virt_xxx barriers
virtio_ring: use virt_store_mb
sh: move xchg_cmpxchg to a header by itself
sh: support 1 and 2 byte xchg
virtio_ring: update weak barriers to use virt_xxx
Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb"
asm-generic: implement virt_xxx memory barriers
x86: define __smp_xxx
xtensa: define __smp_xxx
tile: define __smp_xxx
...
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2b3c22808c3b..c7bf1aa2eeb3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -5116,13 +5116,44 @@ sub process { | |||
5116 | } | 5116 | } |
5117 | } | 5117 | } |
5118 | # check for memory barriers without a comment. | 5118 | # check for memory barriers without a comment. |
5119 | if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) { | 5119 | |
5120 | my $barriers = qr{ | ||
5121 | mb| | ||
5122 | rmb| | ||
5123 | wmb| | ||
5124 | read_barrier_depends | ||
5125 | }x; | ||
5126 | my $barrier_stems = qr{ | ||
5127 | mb__before_atomic| | ||
5128 | mb__after_atomic| | ||
5129 | store_release| | ||
5130 | load_acquire| | ||
5131 | store_mb| | ||
5132 | (?:$barriers) | ||
5133 | }x; | ||
5134 | my $all_barriers = qr{ | ||
5135 | (?:$barriers)| | ||
5136 | smp_(?:$barrier_stems)| | ||
5137 | virt_(?:$barrier_stems) | ||
5138 | }x; | ||
5139 | |||
5140 | if ($line =~ /\b(?:$all_barriers)\s*\(/) { | ||
5120 | if (!ctx_has_comment($first_line, $linenr)) { | 5141 | if (!ctx_has_comment($first_line, $linenr)) { |
5121 | WARN("MEMORY_BARRIER", | 5142 | WARN("MEMORY_BARRIER", |
5122 | "memory barrier without comment\n" . $herecurr); | 5143 | "memory barrier without comment\n" . $herecurr); |
5123 | } | 5144 | } |
5124 | } | 5145 | } |
5125 | 5146 | ||
5147 | my $underscore_smp_barriers = qr{__smp_(?:$barrier_stems)}x; | ||
5148 | |||
5149 | if ($realfile !~ m@^include/asm-generic/@ && | ||
5150 | $realfile !~ m@/barrier\.h$@ && | ||
5151 | $line =~ m/\b(?:$underscore_smp_barriers)\s*\(/ && | ||
5152 | $line !~ m/^.\s*\#\s*define\s+(?:$underscore_smp_barriers)\s*\(/) { | ||
5153 | WARN("MEMORY_BARRIER", | ||
5154 | "__smp memory barriers shouldn't be used outside barrier.h and asm-generic\n" . $herecurr); | ||
5155 | } | ||
5156 | |||
5126 | # check for waitqueue_active without a comment. | 5157 | # check for waitqueue_active without a comment. |
5127 | if ($line =~ /\bwaitqueue_active\s*\(/) { | 5158 | if ($line =~ /\bwaitqueue_active\s*\(/) { |
5128 | if (!ctx_has_comment($first_line, $linenr)) { | 5159 | if (!ctx_has_comment($first_line, $linenr)) { |