Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Minchan Kim
I will fix and resend tomorrow. Huge thanks, Sergey! On Tue, Apr 10, 2018 at 09:41:09AM +0900, Sergey Senozhatsky wrote: > I think zram_debugfs_unregister() is called both from zram_remove() and > from destroy_devices(), which explodes: > > [ 1906.467981] BUG: unable to handle kernel NULL pointer

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Minchan Kim
On Tue, Apr 10, 2018 at 09:03:05AM +0900, Sergey Senozhatsky wrote: > Hi Minchan, > > On (04/09/18 14:54), Minchan Kim wrote: > > +static long long ns2usecs(u64 nsec) > > +{ > > + nsec += 500; > > + do_div(nsec, 1000); > > + return nsec; > > +} > > Sorry, I don't quite understand "nsec += 5

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Sergey Senozhatsky
I think zram_debugfs_unregister() is called both from zram_remove() and from destroy_devices(), which explodes: [ 1906.467981] BUG: unable to handle kernel NULL pointer dereference at 00b8 [ 1906.468007] PGD 8003d5050067 P4D 8003d5050067 PUD 3fa97d067 PMD 0 [ 1906.468029] Oops

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Sergey Senozhatsky
Hi Minchan, On (04/09/18 14:54), Minchan Kim wrote: > +static long long ns2usecs(u64 nsec) > +{ > + nsec += 500; > + do_div(nsec, 1000); > + return nsec; > +} Sorry, I don't quite understand "nsec += 500". > +static ssize_t read_block_state(struct file *file, char __user *buf, > +

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Minchan Kim
On Mon, 9 Apr 2018 10:03:45 +0200 Greg KH wrote: > On Mon, Apr 09, 2018 at 02:54:35PM +0900, Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due to VM's LRU algorithm. > > Especially, once init data for appli

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Greg KH
On Mon, Apr 09, 2018 at 02:54:35PM +0900, Minchan Kim wrote: > zRam as swap is useful for small memory device. However, swap means > those pages on zram are mostly cold pages due to VM's LRU algorithm. > Especially, once init data for application are touched for launching, > they tend to be not acc

[PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-08 Thread Minchan Kim
zRam as swap is useful for small memory device. However, swap means those pages on zram are mostly cold pages due to VM's LRU algorithm. Especially, once init data for application are touched for launching, they tend to be not accessed any more and finally swapped out. zRAM can store such cold page