diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 2d67680a9afc..d6bff78ce8da 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -656,6 +656,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, struct zram_meta *meta = zram->meta; struct zcomp_strm *zstrm = NULL; unsigned long alloced_pages; + static unsigned long zram_rs_time; page = bvec->bv_page; if (is_partial_io(bvec)) { @@ -719,8 +720,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, handle = zs_malloc(meta->mem_pool, clen); if (!handle) { - pr_err("Error allocating memory for compressed page: %u, size=%zu\n", - index, clen); + if (printk_timed_ratelimit(&zram_rs_time, + ALLOC_ERROR_LOG_RATE_MS)) + pr_info("Error allocating memory for compressed page: %u, size=%zu\n", + index, clen); + ret = -ENOMEM; goto out; }