All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Glenn Washburn <development@efficientek.com>
Cc: Daniel Axtens <dja@axtens.net>,
	grub-devel@gnu.org, leif@nuviainc.com, stefanb@linux.ibm.com,
	ps@pks.im
Subject: Re: [PATCH 17/19] [not for merge] print more debug info in mm
Date: Wed, 10 Nov 2021 23:17:54 +0100	[thread overview]
Message-ID: <20211110221754.ekcuhsw4dewo3mod@tomti.i.net-space.pl> (raw)
In-Reply-To: <20211110133512.03537798@crass-HP-ZBook-15-G2>

On Wed, Nov 10, 2021 at 01:35:12PM -0600, Glenn Washburn wrote:
> On Wed, 10 Nov 2021 14:47:07 +0100
> Daniel Kiper <dkiper@net-space.pl> wrote:
>
> > CC-ing Glenn...
> >
> > On Tue, Oct 12, 2021 at 06:30:06PM +1100, Daniel Axtens wrote:
> > > This is handy for debugging - I'm including it in case anyone else hacking
> > > on this area finds it helpful.
> > >
> > > Signed-off-by: Daniel Axtens <dja@axtens.net>
> > > ---
> > >  grub-core/kern/mm.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
> > > index 58d5b89e8860..811df1ab5ebb 100644
> > > --- a/grub-core/kern/mm.c
> > > +++ b/grub-core/kern/mm.c
> > > @@ -135,6 +135,9 @@ grub_mm_init_region (void *addr, grub_size_t size)
> > >    for (p = &grub_mm_base, q = *p; q; p = &(q->next), q = *p)
> > >      {
> > >        /* Does this region come _before_ an existing region? */
> > > +      grub_printf ("Extending w/ before %p + %" PRIxGRUB_SIZE " + %" PRIxGRUB_SIZE " = %p ? %s\n",
> > > +		 (grub_uint8_t *)addr, size, q->pre_size, (grub_uint8_t *)q,
> > > +		 (grub_uint8_t *)addr + size + q->pre_size == (grub_uint8_t *) q ? "yes" : "no");
> >
> > I think this kind of messages can be useful. Same applies to patch #18.
> > Though I would use grub_dprintf() instead which should be wrapped with
> > #ifdef MM_DEBUG. However, we have to be very careful with printing any
> > messages from mm and do not exeecec 255 chars message length. If we go
> > above that limit then we will trigger dynamic allocation in grub_dprintf()
> > from mm which may lead to a recursion...
> >
> > Additionally, I think Glenn's patch allowing us to disable logging from
> > certain subsystem would be useful here. Glenn, could you take a look at
> > it once again?
>
> Yes, I'm planning on it. Its been low priority for me and this month is

Cool! Thanks!

> very busy fo me IRL. I don't think my patches should hold this up
> though (or would this cause way to much logs if one didn't want them?)

No rush...

Daniel


  reply	other threads:[~2021-11-10 22:18 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  7:29 [PATCH 00/19] Requesting more memory from firmware Daniel Axtens
2021-10-12  7:29 ` [PATCH 01/19] grub-shell: Boot PowerPC using PMU instead of CUDA for power management Daniel Axtens
2021-10-12 17:11   ` Glenn Washburn
2021-10-20 15:39     ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 02/19] grub-shell: pseries: don't pass fw_opt to qemu Daniel Axtens
2021-10-12 18:57   ` Glenn Washburn
2021-10-20 15:43     ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 03/19] mm: document grub internal memory management structures Daniel Axtens
2021-10-12 19:18   ` Glenn Washburn
2021-11-24  0:57     ` Daniel Axtens
2021-10-12  7:29 ` [PATCH 04/19] mm: assert that we preserve header vs region alignment Daniel Axtens
2021-10-20 17:43   ` Daniel Kiper
2022-03-23  5:47     ` Daniel Axtens
2022-03-24 15:20       ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 05/19] mm: when adding a region, merge with region after as well as before Daniel Axtens
2021-11-04 16:36   ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 06/19] configure: properly pass through MM_DEBUG Daniel Axtens
2021-11-04 18:00   ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 07/19] Add memtool module with memory allocation stress-test Daniel Axtens
2021-10-19 19:47   ` Glenn Washburn
2021-11-09 12:54   ` Daniel Kiper
2021-11-10 22:29     ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 08/19] mm: Drop unused unloading of modules on OOM Daniel Axtens
2021-11-09 13:15   ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 09/19] mm: Allow dynamically requesting additional memory regions Daniel Axtens
2021-11-09 13:25   ` Daniel Kiper
2021-10-12  7:29 ` [PATCH 10/19] efi: mm: Always request a fixed number of pages on init Daniel Axtens
2021-11-09 13:32   ` Daniel Kiper
2021-10-12  7:30 ` [PATCH 11/19] efi: mm: Extract function to add memory regions Daniel Axtens
2021-10-19 21:39   ` Glenn Washburn
2021-10-19 21:58   ` Glenn Washburn
2022-03-25  3:30     ` Daniel Axtens
2021-11-09 13:38   ` Daniel Kiper
2021-10-12  7:30 ` [PATCH 12/19] efi: mm: Pass up errors from `add_memory_regions ()` Daniel Axtens
2021-10-19 21:37   ` Glenn Washburn
2021-11-09 13:56     ` Daniel Kiper
2021-11-09 16:10   ` Daniel Kiper
2021-10-12  7:30 ` [PATCH 13/19] efi: mm: Implement runtime addition of pages Daniel Axtens
2021-11-09 16:13   ` Daniel Kiper
2021-10-12  7:30 ` [PATCH 14/19] ieee1275: request memory with ibm, client-architecture-support Daniel Axtens
2021-10-12  7:30 ` [PATCH 15/19] ieee1275: drop len -= 1 quirk in heap_init Daniel Axtens
2021-10-12  7:30 ` [PATCH 16/19] ieee1275: support runtime memory claiming Daniel Axtens
2021-10-12  7:30 ` [PATCH 17/19] [not for merge] print more debug info in mm Daniel Axtens
2021-11-10 13:47   ` Daniel Kiper
2021-11-10 19:35     ` Glenn Washburn
2021-11-10 22:17       ` Daniel Kiper [this message]
2021-10-12  7:30 ` [PATCH 18/19] [not for merge] ieee1275 debugging info Daniel Axtens
2021-10-12  7:30 ` [PATCH 19/19] RFC: Ignore REGION_CONSECUTIVE Daniel Axtens
2021-11-10 14:00   ` Daniel Kiper

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=20211110221754.ekcuhsw4dewo3mod@tomti.i.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=development@efficientek.com \
    --cc=dja@axtens.net \
    --cc=grub-devel@gnu.org \
    --cc=leif@nuviainc.com \
    --cc=ps@pks.im \
    --cc=stefanb@linux.ibm.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.