Commit 98ed9120 authored by Ben Hutchings's avatar Ben Hutchings

Revert "zram: use zram->lock to protect zram_free_page() in swap free notify path"

This reverts commit 9e443904, which
was commit 57ab0485 upstream.

Taking the semaphore here leads to sleeping in atomic context.  This
was fixed in mainline commit a0c516cb ("zram: don't grab mutex in
zram_slot_free_noity") but that is too difficult to backport.
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 8f0ce108
......@@ -709,9 +709,7 @@ static void zram_slot_free_notify(struct block_device *bdev,
struct zram *zram;
zram = bdev->bd_disk->private_data;
down_write(&zram->lock);
zram_free_page(zram, index);
up_write(&zram->lock);
zram_stat64_inc(zram, &zram->stats.notify_free);
}
......
......@@ -107,9 +107,8 @@ struct zram {
void *compress_buffer;
struct table *table;
spinlock_t stat64_lock; /* protect 64-bit stats */
struct rw_semaphore lock; /* protect compression buffers, table,
* 32bit stat counters against concurrent
* notifications, reads and writes */
struct rw_semaphore lock; /* protect compression buffers and table
* against concurrent read and writes */
struct request_queue *queue;
struct gendisk *disk;
int init_done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment