linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Mike Rapoport <rppt@linux.vnet.ibm.com>,
	Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH 1/2] zsmalloc: introduce zs_huge_object() function
Date: Fri, 9 Feb 2018 14:36:30 +0900	[thread overview]
Message-ID: <20180209053630.GC689@jagdpanzerIV> (raw)
In-Reply-To: <20180209041046.GB23828@bombadil.infradead.org>

On (02/08/18 20:10), Matthew Wilcox wrote:
[..]
> Examples::
> 
>   * Context: Any context.
>   * Context: Any context. Takes and releases the RCU lock.
>   * Context: Any context. Expects <lock> to be held by caller.
>   * Context: Process context. May sleep if @gfp flags permit.
>   * Context: Process context. Takes and releases <mutex>.
>   * Context: Softirq or process context. Takes and releases <lock>, BH-safe.
>   * Context: Interrupt context.

I assume that  <mutex>  spelling serves as a placeholder and should be
replaced with a lock name in a real comment. E.g.

	Takes and releases audit_cmd_mutex.

or should it actually be

	Takes and releases <audit_cmd_mutex>.




So below is zs_huge_object() documentation I came up with:

---

+/**
+ * zs_huge_object() - Test if a compressed object's size is too big for normal
+ *                    zspool classes and it will be stored in a huge class.
+ * @sz: Size in bytes of the compressed object.
+ *
+ * The functions checks if the object's size falls into huge_class area.
+ * We must take ZS_HANDLE_SIZE into account and test the actual size we
+ * are going to use up, because zs_malloc() unconditionally adds the
+ * handle size before it performs size_class lookup.
+ *
+ * Context: Any context.
+ *
+ * Return:
+ * * true  - The object's size is too big, it will be stored in a huge class.
+ * * false - The object will be store in normal zspool classes.
+ */
---

looks OK?

	-ss

  parent reply	other threads:[~2018-02-09  5:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07  9:29 [PATCH 0/2] zsmalloc/zram: drop zram's max_zpage_size Sergey Senozhatsky
2018-02-07  9:29 ` [PATCH 1/2] zsmalloc: introduce zs_huge_object() function Sergey Senozhatsky
2018-02-08 16:30   ` Mike Rapoport
2018-02-09  2:55     ` Sergey Senozhatsky
2018-02-09  4:10       ` Matthew Wilcox
2018-02-09  5:04         ` Sergey Senozhatsky
2018-02-09  5:36         ` Sergey Senozhatsky [this message]
2018-02-09  5:48           ` Sergey Senozhatsky
2018-02-09 11:11           ` Mike Rapoport
2018-02-09 12:34             ` Sergey Senozhatsky
2018-02-10  8:23   ` [PATCHv2 " Sergey Senozhatsky
2018-02-11  7:05     ` Mike Rapoport
2018-02-14  5:52       ` Sergey Senozhatsky
2018-02-14  5:57     ` [PATCHv3 " Sergey Senozhatsky
2018-02-20  1:24       ` Minchan Kim
2018-02-26  5:49         ` Sergey Senozhatsky
2018-02-26  5:58           ` Minchan Kim
2018-02-26  6:50             ` Sergey Senozhatsky
2018-02-26  7:46               ` Minchan Kim
2018-02-26  8:12                 ` Sergey Senozhatsky
2018-02-07  9:29 ` [PATCH 2/2] zram: drop max_zpage_size and use zs_huge_object() Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180209053630.GC689@jagdpanzerIV \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).