On (24/12/02 18:07), caiqingfu wrote: > > What's your use-case, what apps you run and what data is stored > > on zram disk? > > The steps to reproduce are as follows: > > 1. force slow path,then re-build kernel > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 0ca6d55c9917..29ac52a4f2e7 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -1683,12 +1683,14 @@ static int zram_write_page(struct zram *zram, struct page *page, u32 index) > * if we have a 'non-null' handle here then we are coming > * from the slow path and handle has already been allocated. > */ > + /* > if (IS_ERR_VALUE(handle)) > handle = zs_malloc(zram->mem_pool, comp_len, > __GFP_KSWAPD_RECLAIM | > __GFP_NOWARN | > __GFP_HIGHMEM | > __GFP_MOVABLE); > + */ > if (IS_ERR_VALUE(handle)) { > zcomp_stream_put(zram->comps[ZRAM_PRIMARY_COMP]); > atomic64_inc(&zram->stats.writestall); > > 2. create an arm64 virtual machine > > qemu-system-aarch64 -M virt -cpu cortex-a57 -smp 4 -m 1024 -kernel kernel-build/arch/arm64/boot/Image \ > -nographic -append "console=ttyAMA0,115200 root=/dev/vda rw" \ > -drive file=$(IMGFILE),format=raw -nic user,hostfwd=tcp::60022-:22 > > 3. after the virtual machine is started, create zram > > cat /sys/class/zram-control/hot_add > echo 524288000 > /sys/devices/virtual/block/zram0/disksize > echo 524288000 > /sys/devices/virtual/block/zram1/disksize > mkfs.ext4 -O ^has_journal -b 4096 -F -L TEMP -m 0 /dev/zram0 > mkdir /tmp/zram > mount -t ext4 -o errors=continue,nosuid,nodev,noatime /dev/zram0 /tmp/zram > mkswap /dev/zram1 > swapon /dev/zram1 > echo 100 > /proc/sys/vm/swappiness > mkdir -p /tmp/zram/stressTest > > > 4. build demo app and run again and again > I was more curious whether you have a real-world example/app that does it.