Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1504480

Re: [patch v2] drivers/zram: Don't disable preemption in zcomp_stream_get/put()

From Mike Galbraith <umgwanakikbuti@gmail.com>
Newsgroups linux.kernel
Subject Re: [patch v2] drivers/zram: Don't disable preemption in zcomp_stream_get/put()
Date 2016-10-20 05:00 +0200
Message-ID <subKh-1Ad-5@gated-at.bofh.it> (permalink)
References <spcH2-6dt-141@gated-at.bofh.it> <ssK9r-62-1@gated-at.bofh.it> <sth5n-4CT-1@gated-at.bofh.it> <su1rC-3fC-115@gated-at.bofh.it> <su2nD-3Wn-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2016-10-19 at 18:54 +0200, Sebastian Andrzej Siewior wrote:
> On 2016-10-19 17:56:30 [+0200], Mike Galbraith wrote:
> > In v4.7, the driver switched to percpu compression streams, disabling
> > preemption vai get/put_cpu_ptr().  Use a local lock instead for RT.
> > We also have to fix an RT lock order issue in zram_decompress_page()
> > such that zs_map_object() nests inside of zcomp_stream_put() as it
> > does in zram_bvec_write().
> 
> good. I almost had it myself. So let me get that one. And your previous
> one (the spinlock replacement) looks also reasonable. With this hunk
> 
> @@ -313,6 +314,7 @@ struct mapping_area {
>  #endif
>         char *vm_addr; /* address of kmap_atomic()'ed pages */
>         enum zs_mapmode vm_mm; /* mapping mode */
> +       spinlock_t      ma_lock;
>  };
>  
>  #ifdef CONFIG_COMPACTION
> @@ -1489,6 +1491,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle,
>         off = (class->size * obj_idx) & ~PAGE_MASK;
>  
>         area = per_cpu_ptr(&zs_map_area, get_cpu_light());
> +       spin_lock(&area->ma_lock);
>         area->vm_mm = mm;
>         if (off + class->size <= PAGE_SIZE) {
>                 /* this object is contained entirely within a page */
> @@ -1542,6 +1545,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
>  
>                 __zs_unmap_object(area, pages, off, class->size);
>         }
> +       spin_unlock(&area->ma_lock);
>         put_cpu_light();
>  
>         migrate_read_unlock(zspage);

Ew, yeah, as the other, I thought it was covered, but nope.

	-Mike

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-10-16 05:20 +0200
  Re: [patch] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-17 16:30 +0200
    Re: [patch] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-10-17 18:20 +0200
      Re: [patch] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-17 18:30 +0200
        Re: [patch] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-10-17 19:20 +0200
          Re: [patch] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-10-17 19:50 +0200
    [patch v2] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-10-19 18:00 +0200
      Re: [patch v2] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-19 19:00 +0200
        Re: [patch v2] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Mike Galbraith <umgwanakikbuti@gmail.com> - 2016-10-20 05:00 +0200
      Re: [patch v2] drivers/zram: Don't disable preemption in  zcomp_stream_get/put() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-10-20 13:10 +0200

csiph-web