linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kuan-Ying Lee (李冠穎)" <Kuan-Ying.Lee@mediatek.com>
To: "oleg@redhat.com" <oleg@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Qun-wei Lin (林群崴)" <Qun-wei.Lin@mediatek.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"Chinwen Chang (張錦文)" <chinwen.chang@mediatek.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Casper Li (李中榮)" <casper.li@mediatek.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"kbingham@kernel.org" <kbingham@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"jan.kiszka@siemens.com" <jan.kiszka@siemens.com>
Subject: Re: [PATCH 1/3] scripts/gdb/tasks: Fix lx-ps command error
Date: Tue, 28 Nov 2023 11:45:20 +0000	[thread overview]
Message-ID: <783d1e6d26c16fd846bb600d00c99a3ca074ccc6.camel@mediatek.com> (raw)
In-Reply-To: <20231127120314.GA19669@redhat.com>

On Mon, 2023-11-27 at 13:03 +0100, Oleg Nesterov wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On 11/27, Kuan-Ying Lee wrote:
> >
> > @@ -25,13 +25,9 @@ def task_lists():
> >      t = g = init_task
> >  
> >      while True:
> > -        while True:
> > -            yield t
> > -
> > -            t = utils.container_of(t['thread_group']['next'],
> > -                                   task_ptr_type, "thread_group")
> > -            if t == g:
> > -                break
> > +        thread_head = t['signal']['thread_head']
> > +        for thread in lists.list_for_each_entry(thread_head,
> task_ptr_type, 'thread_node'):
> > +            yield thread
> >  
> >          t = g = utils.container_of(g['tasks']['next'],
> >                                     task_ptr_type, "tasks")
> 
> Thanks!
> 
> I do not know python, but it seems that with this patch we can kill g
> or t?
> Can't
> 
> def task_lists():
>     task_ptr_type = task_type.get_type().pointer()
>     init_task = gdb.parse_and_eval("init_task").address
>     t = init_task
> 
>     while True:
> thread_head = t['signal']['thread_head']
> for thread in lists.list_for_each_entry(thread_head, task_ptr_type,
> 'thread_node'):
>     yield thread
> 
> t = utils.container_of(t['tasks']['next'],
>        task_ptr_type, "tasks")
> if t == init_task:
>     return
> 
> work?

Yes, you are right.
I will fix it in v2.

Thanks,
Kuan-Ying Lee
> 
> Oleg.
> 

  reply	other threads:[~2023-11-28 11:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27  7:04 [PATCH 0/3] Fix GDB commands error Kuan-Ying Lee
2023-11-27  7:04 ` [PATCH 1/3] scripts/gdb/tasks: Fix lx-ps command error Kuan-Ying Lee
2023-11-27 12:03   ` Oleg Nesterov
2023-11-28 11:45     ` Kuan-Ying Lee (李冠穎) [this message]
2023-11-27  7:04 ` [PATCH 2/3] scripts/gdb/stackdepot: Rename pool_index_cached to pools_num Kuan-Ying Lee
2023-11-27  7:04 ` [PATCH 3/3] scripts/gdb: Remove exception handling and refine print format Kuan-Ying Lee

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=783d1e6d26c16fd846bb600d00c99a3ca074ccc6.camel@mediatek.com \
    --to=kuan-ying.lee@mediatek.com \
    --cc=Qun-wei.Lin@mediatek.com \
    --cc=akpm@linux-foundation.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=casper.li@mediatek.com \
    --cc=chinwen.chang@mediatek.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=matthias.bgg@gmail.com \
    --cc=oleg@redhat.com \
    --cc=stable@vger.kernel.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