[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150305003052.GA2592@blaptop>
Date: Thu, 5 Mar 2015 09:30:52 +0900
From: Minchan Kim <minchan@...nel.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: ddstreet@...e.org, gunho.lee@....com, iamjoonsoo.kim@....com,
jmarchan@...hat.com, juno.choi@....com, mel@....ul.ie,
ngupta@...are.org, semenzato@...gle.com,
sergey.senozhatsky@...il.com, sjennings@...iantweb.net,
mm-commits@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: + zram-support-compaction.patch added to -mm tree
Hello Sergey,
On Thu, Mar 05, 2015 at 09:18:45AM +0900, Sergey Senozhatsky wrote:
> Hello,
>
> On (03/04/15 14:02), akpm@...ux-foundation.org wrote:
> [..]
> > +++ a/drivers/block/zram/zram_drv.c
> > @@ -70,6 +70,27 @@ static inline struct zram *dev_to_zram(s
> > return (struct zram *)dev_to_disk(dev)->private_data;
> > }
> >
> > +static ssize_t compact_store(struct device *dev,
> > + struct device_attribute *attr, const char *buf, size_t len)
> > +{
> > + unsigned long nr_migrated;
> > + struct zram *zram = dev_to_zram(dev);
> > + struct zram_meta *meta;
> > +
> > + down_read(&zram->init_lock);
> > + if (!init_done(zram)) {
> > + up_read(&zram->init_lock);
> > + return -EINVAL;
> > + }
> > +
> > + meta = zram->meta;
> > + nr_migrated = zs_compact(meta->mem_pool);
> > + atomic64_add(nr_migrated, &zram->stats.num_migrated);
> > + up_read(&zram->init_lock);
> > +
> > + return len;
> > +}
> > +
> > /* flag operations require table entry bit_spin_lock() being held */
> > static int zram_test_flag(struct zram_meta *meta, u32 index,
> > enum zram_pageflags flag)
>
>
> let's stick to "helpers, attrs show/store, mm (meta, page), IO, zram control"
> function layout.
>
> so can we please put compact_store() after, say,
> 354 static ssize_t comp_algorithm_store(...)
>
> function?
I will clean it up after Andrew releases new mmotm. :)
Thanks for the review!
--
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists