All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Strogin <s.strogin@partner.samsung.com>
To: Gioh Kim <gioh.kim@lge.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Stefan Strogin <stefan.strogin@gmail.com>,
	Michal Nazarewicz <mina86@mina86.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	aneesh.kumar@linux.vnet.ibm.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Pintu Kumar <pintu.k@samsung.com>,
	Weijie Yang <weijie.yang@samsung.com>,
	Laura Abbott <lauraa@codeaurora.org>, Hui Zhu <zhuhui@xiaomi.com>,
	Minchan Kim <minchan@kernel.org>,
	Dyasly Sergey <s.dyasly@samsung.com>,
	Vyacheslav Tyrtov <v.tyrtov@samsung.com>,
	s.strogin@partner.samsung.com
Subject: Re: [PATCH 2/3] mm: cma: introduce /proc/cmainfo
Date: Fri, 23 Jan 2015 15:32:09 +0300	[thread overview]
Message-ID: <54C23F49.8040109@partner.samsung.com> (raw)
In-Reply-To: <54A34E01.2050405@lge.com>

Hello Gioh,

On 31/12/14 04:14, Gioh Kim wrote:
>
> Is it ok if the information is too big?
> I'm not sure but I remember that seq_printf has 4K limitation.

Thanks for reviewing, excuse me for a long delay.

If I understand correctly it is OK, since it's written in comments for
seq_has_overflowed():
>  * seq_files have a buffer which may overflow. When this happens a larger
>  * buffer is reallocated and all the data will be printed again.
>  * The overflow state is true when m->count == m->size.
And exactly this happens in traverse().

But I think that it's not important anymore as I intent not to use
seq_files in the second version.


>
> So I made seq_operations with seq_list_start/next functions.
>
> EX)
>
> static void *debug_seq_start(struct seq_file *s, loff_t *pos)
> {
> A>>       mutex_lock(&debug_lock);
> A>>       return seq_list_start(&debug_list, *pos);
> }   
>
> static void debug_seq_stop(struct seq_file *s, void *data)
> {
> A>>       struct debug_header *header = data;
>
> A>>       if (header == NULL || &header->head_list == &debug_list) {
> A>>       A>>       seq_printf(s, "end of info");
> A>>       }
>
> A>>       mutex_unlock(&debug_lock);
> }
>
> static void *debug_seq_next(struct seq_file *s, void *data, loff_t *pos)
> {
> A>>       return seq_list_next(data, &debug_list, pos);
> }
>
> static int debug_seq_show(struct seq_file *sfile, void *data)
> {
> A>>       struct debug_header *header;
> A>>       char *p;
>
> A>>       header= list_entry(data,
> A>>       A>>       A>>          struct debug_header,   
> A>>       A>>       A>>          head_list);
>
> A>>       seq_printf(sfile, "print info");
> A>>       return 0;
> }
> static const struct seq_operations debug_seq_ops = {
> A>>       .start = debug_seq_start,   
> A>>       .next = debug_seq_next,   
> A>>       .stop = debug_seq_stop,   
> A>>       .show = debug_seq_show,   
> };

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Stefan Strogin <s.strogin@partner.samsung.com>
To: Gioh Kim <gioh.kim@lge.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Stefan Strogin <stefan.strogin@gmail.com>,
	Michal Nazarewicz <mina86@mina86.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	aneesh.kumar@linux.vnet.ibm.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Pintu Kumar <pintu.k@samsung.com>,
	Weijie Yang <weijie.yang@samsung.com>,
	Laura Abbott <lauraa@codeaurora.org>, Hui Zhu <zhuhui@xiaomi.com>,
	Minchan Kim <minchan@kernel.org>,
	Dyasly Sergey <s.dyasly@samsung.com>,
	Vyacheslav Tyrtov <v.tyrtov@samsung.com>,
	s.strogin@partner.samsung.com
Subject: Re: [PATCH 2/3] mm: cma: introduce /proc/cmainfo
Date: Fri, 23 Jan 2015 15:32:09 +0300	[thread overview]
Message-ID: <54C23F49.8040109@partner.samsung.com> (raw)
In-Reply-To: <54A34E01.2050405@lge.com>

Hello Gioh,

On 31/12/14 04:14, Gioh Kim wrote:
>
> Is it ok if the information is too big?
> I'm not sure but I remember that seq_printf has 4K limitation.

Thanks for reviewing, excuse me for a long delay.

If I understand correctly it is OK, since it's written in comments for
seq_has_overflowed():
>  * seq_files have a buffer which may overflow. When this happens a larger
>  * buffer is reallocated and all the data will be printed again.
>  * The overflow state is true when m->count == m->size.
And exactly this happens in traverse().

But I think that it's not important anymore as I intent not to use
seq_files in the second version.


>
> So I made seq_operations with seq_list_start/next functions.
>
> EX)
>
> static void *debug_seq_start(struct seq_file *s, loff_t *pos)
> {
> »       mutex_lock(&debug_lock);
> »       return seq_list_start(&debug_list, *pos);
> }   
>
> static void debug_seq_stop(struct seq_file *s, void *data)
> {
> »       struct debug_header *header = data;
>
> »       if (header == NULL || &header->head_list == &debug_list) {
> »       »       seq_printf(s, "end of info");
> »       }
>
> »       mutex_unlock(&debug_lock);
> }
>
> static void *debug_seq_next(struct seq_file *s, void *data, loff_t *pos)
> {
> »       return seq_list_next(data, &debug_list, pos);
> }
>
> static int debug_seq_show(struct seq_file *sfile, void *data)
> {
> »       struct debug_header *header;
> »       char *p;
>
> »       header= list_entry(data,
> »       »       »          struct debug_header,   
> »       »       »          head_list);
>
> »       seq_printf(sfile, "print info");
> »       return 0;
> }
> static const struct seq_operations debug_seq_ops = {
> »       .start = debug_seq_start,   
> »       .next = debug_seq_next,   
> »       .stop = debug_seq_stop,   
> »       .show = debug_seq_show,   
> };


  reply	other threads:[~2015-01-23 12:32 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-26 14:39 [PATCH 0/3] mm: cma: /proc/cmainfo Stefan I. Strogin
2014-12-26 14:39 ` Stefan I. Strogin
2014-12-26 14:39 ` [PATCH 1/3] stacktrace: add seq_print_stack_trace() Stefan I. Strogin
2014-12-26 14:39   ` Stefan I. Strogin
2014-12-27  7:04   ` SeongJae Park
2014-12-27  7:04     ` SeongJae Park
2014-12-26 14:39 ` [PATCH 2/3] mm: cma: introduce /proc/cmainfo Stefan I. Strogin
2014-12-26 14:39   ` Stefan I. Strogin
2014-12-26 16:02   ` Michal Nazarewicz
2014-12-26 16:02     ` Michal Nazarewicz
2014-12-29 14:09     ` Stefan Strogin
2014-12-29 14:09       ` Stefan Strogin
2014-12-29 17:26       ` Michal Nazarewicz
2014-12-29 17:26         ` Michal Nazarewicz
2014-12-31  1:14       ` Gioh Kim
2014-12-31  1:14         ` Gioh Kim
2015-01-23 12:32         ` Stefan Strogin [this message]
2015-01-23 12:32           ` Stefan Strogin
2014-12-29 21:11   ` Laura Abbott
2014-12-29 21:11     ` Laura Abbott
2015-01-21 14:18     ` Stefan Strogin
2015-01-21 14:18       ` Stefan Strogin
2014-12-30  4:38   ` Joonsoo Kim
2014-12-30  4:38     ` Joonsoo Kim
2015-01-22 15:35     ` Stefan Strogin
2015-01-22 15:35       ` Stefan Strogin
2015-01-23  6:35       ` Joonsoo Kim
2015-01-23  6:35         ` Joonsoo Kim
2014-12-26 14:39 ` [PATCH 3/3] cma: add functions to get region pages counters Stefan I. Strogin
2014-12-26 14:39   ` Stefan I. Strogin
2014-12-26 16:10   ` Michal Nazarewicz
2014-12-26 16:10     ` Michal Nazarewicz
2014-12-27  7:18   ` SeongJae Park
2014-12-27  7:18     ` SeongJae Park
2014-12-29  5:56     ` Safonov Dmitry
2014-12-29  5:56       ` Safonov Dmitry
2014-12-29 14:12       ` Stefan Strogin
2014-12-29 14:12         ` Stefan Strogin
2014-12-30  2:26   ` Joonsoo Kim
2014-12-30  2:26     ` Joonsoo Kim
2014-12-30 14:41     ` Michal Nazarewicz
2014-12-30 14:41       ` Michal Nazarewicz
2014-12-30 14:46       ` Safonov Dmitry
2014-12-30 14:46         ` Safonov Dmitry
2014-12-29  2:36 ` [PATCH 0/3] mm: cma: /proc/cmainfo Minchan Kim
2014-12-29  2:36   ` Minchan Kim
2014-12-29 19:52   ` Laura Abbott
2014-12-29 19:52     ` Laura Abbott
2014-12-30  4:47     ` Minchan Kim
2014-12-30  4:47       ` Minchan Kim
2014-12-30 22:00       ` Laura Abbott
2014-12-30 22:00         ` Laura Abbott
2014-12-31  0:25         ` Minchan Kim
2014-12-31  0:25           ` Minchan Kim
2015-01-21 13:52           ` Stefan Strogin
2015-01-21 13:52             ` Stefan Strogin
2015-01-23  6:33             ` Joonsoo Kim
2015-01-23  6:33               ` Joonsoo Kim
2014-12-31  0:58       ` Gioh Kim
2014-12-31  0:58         ` Gioh Kim
2014-12-31  2:18         ` Minchan Kim
2014-12-31  2:18           ` Minchan Kim
2014-12-31  2:45           ` Gioh Kim
2014-12-31  2:45             ` Gioh Kim
2014-12-31  6:47         ` Namhyung Kim
2014-12-31  6:47           ` Namhyung Kim
2014-12-31  7:32           ` Minchan Kim
2014-12-31  7:32             ` Minchan Kim
2015-01-09 14:19       ` Steven Rostedt
2015-01-09 14:19         ` Steven Rostedt
2015-01-09 14:35         ` Steven Rostedt
2015-01-09 14:35           ` Steven Rostedt
2015-01-13  2:27         ` Minchan Kim
2015-01-13  2:27           ` Minchan Kim
2015-01-02  5:11   ` Pavel Machek
2015-01-02  5:11     ` Pavel Machek
2015-01-22 15:44     ` Stefan Strogin
2015-01-22 15:44       ` Stefan Strogin

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=54C23F49.8040109@partner.samsung.com \
    --to=s.strogin@partner.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=gioh.kim@lge.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=lauraa@codeaurora.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mina86@mina86.com \
    --cc=minchan@kernel.org \
    --cc=pintu.k@samsung.com \
    --cc=s.dyasly@samsung.com \
    --cc=stefan.strogin@gmail.com \
    --cc=v.tyrtov@samsung.com \
    --cc=weijie.yang@samsung.com \
    --cc=zhuhui@xiaomi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.