summaryrefslogtreecommitdiff
path: root/kern/sref.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-09-23 00:16:32 +0200
committerRichard Braun <rbraun@sceen.net>2014-09-23 00:16:32 +0200
commite53d1a6c5faac903cc2dd684bf552b90df094c64 (patch)
treed7ad0718f3e542bf3ff8d7c18fece16360f76eba /kern/sref.c
parentb91e022b0c69f8901744307ec8a86068fc80ae15 (diff)
kern/sref: fix handling of dirty zeroes on review
Diffstat (limited to 'kern/sref.c')
-rw-r--r--kern/sref.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kern/sref.c b/kern/sref.c
index c10dbc9..6c84512 100644
--- a/kern/sref.c
+++ b/kern/sref.c
@@ -633,17 +633,17 @@ sref_review(struct sref_queue *queue)
spinlock_lock(&counter->lock);
assert(sref_counter_is_queued(counter));
- sref_counter_clear_queued(counter);
- sref_counter_clear_dirty(counter);
- if (counter->value != 0)
- spinlock_unlock(&counter->lock);
- else if (sref_counter_is_dirty(counter)) {
+ if ((counter->value != 0) || (sref_counter_is_dirty(counter))) {
sref_counter_clear_queued(counter);
sref_counter_clear_dirty(counter);
- sref_counter_schedule_review(counter);
+
+ if (counter->value == 0) {
+ sref_counter_schedule_review(counter);
+ nr_dirty++;
+ }
+
spinlock_unlock(&counter->lock);
- nr_dirty++;
} else {
/*
* Keep in mind that the work structure shares memory with