Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-27 Thread Sergey Senozhatsky
On (11/26/16 23:41), Minchan Kim wrote: [..] > > > mutex_lock(>bd_mutex); > > > > why not set it just once, when we allocate queue/disk and configure both > > of them: in zram_add() > > I should have mentioned the reason. > The revalidate_disk reset the BDI_CAP_STABLE_WRITES. aha. either

Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-27 Thread Sergey Senozhatsky
On (11/26/16 23:41), Minchan Kim wrote: [..] > > > mutex_lock(>bd_mutex); > > > > why not set it just once, when we allocate queue/disk and configure both > > of them: in zram_add() > > I should have mentioned the reason. > The revalidate_disk reset the BDI_CAP_STABLE_WRITES. aha. either

Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-26 Thread Minchan Kim
Hi Sergey, On Sat, Nov 26, 2016 at 03:37:01PM +0900, Sergey Senozhatsky wrote: > Hello Minchan, > > On (11/25/16 17:35), Minchan Kim wrote: > [..] > > +static void zram_revalidate_disk(struct zram *zram) > > +{ > > + revalidate_disk(zram->disk); > > +

Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-26 Thread Minchan Kim
Hi Sergey, On Sat, Nov 26, 2016 at 03:37:01PM +0900, Sergey Senozhatsky wrote: > Hello Minchan, > > On (11/25/16 17:35), Minchan Kim wrote: > [..] > > +static void zram_revalidate_disk(struct zram *zram) > > +{ > > + revalidate_disk(zram->disk); > > +

Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-25 Thread Sergey Senozhatsky
Hello Minchan, On (11/25/16 17:35), Minchan Kim wrote: [..] > +static void zram_revalidate_disk(struct zram *zram) > +{ > + revalidate_disk(zram->disk); > + zram->disk->queue->backing_dev_info.capabilities |= > + BDI_CAP_STABLE_WRITES; > +} > + > /* > * Check if request is

Re: [PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-25 Thread Sergey Senozhatsky
Hello Minchan, On (11/25/16 17:35), Minchan Kim wrote: [..] > +static void zram_revalidate_disk(struct zram *zram) > +{ > + revalidate_disk(zram->disk); > + zram->disk->queue->backing_dev_info.capabilities |= > + BDI_CAP_STABLE_WRITES; > +} > + > /* > * Check if request is

[PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-25 Thread Minchan Kim
zram has used per-cpu stream feature from v4.7. It aims for increasing cache hit ratio of scratch buffer for compressing. Downside of that approach is that zram should ask memory space for compressed page in per-cpu context which requires stricted gfp flag which could be failed. If so, it retries

[PATCH v3 3/3] zram: support BDI_CAP_STABLE_WRITES

2016-11-25 Thread Minchan Kim
zram has used per-cpu stream feature from v4.7. It aims for increasing cache hit ratio of scratch buffer for compressing. Downside of that approach is that zram should ask memory space for compressed page in per-cpu context which requires stricted gfp flag which could be failed. If so, it retries