mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Kavitha Daula <kavithadaula@Kavithas-MacBook-Pro.local>,
	sstabellini@kernel.org
Cc: oleksandr_tyshchenko@epam.com, xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org, Kavitha Daula <kavi@edera.dev>
Subject: Re: [PATCH] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()
Date: Mon, 9 Nov 2026 09:04:03 +0100	[thread overview]
Message-ID: <7b3fe96c-15f2-4ab8-a818-16974df306ae@suse.com> (raw)
In-Reply-To: <20261105000137.82224-1-kavithadaula@Kavithas-MacBook-Pro.local>


[-- Attachment #1.1: Type: text/plain, Size: 1851 bytes --]

On 05.11.26 01:01, Kavitha Daula wrote:
> From: Kavitha Daula <kavi@edera.dev>
> 
> Both callers of gnttab_unmap_refs_sync(), free_persistent_gnts() and
> xen_blkbk_unmap_purged_grants() in blkback, keep their struct
> gntab_unmap_queue_data on the stack. gnttab_unmap_refs_async() sets up
> the delayed work inside it with INIT_DELAYED_WORK(), so with
> CONFIG_DEBUG_OBJECTS_WORK and CONFIG_DEBUG_OBJECTS_TIMERS every
> persistent grant teardown warns twice, once for the work and once for
> its timer:
> 
>    [  104.366085] ODEBUG: object ffffc9004020fad8 is on stack ffffc9004020c000, but NOT annotated.
>    [  104.371551] WARNING: CPU: 1 PID: 48 at lib/debugobjects.c:672 lookup_object_or_alloc.part.0+0x12b/0x1f0
>    Call Trace:
>     <TASK>
>     __debug_object_init+0xfe/0x1a0
>     debug_object_init+0x38/0x50
>     __init_work+0x28/0x30
>     gnttab_unmap_refs_async+0x18/0xa0
>     gnttab_unmap_refs_sync+0x61/0x90
>     free_persistent_gnts+0x179/0x280
>     xen_blkbk_free_caches+0x16/0x30
>     xen_blkif_disconnect+0xfa/0x2d0
>     frontend_changed+0x90/0x680
>     xenbus_otherend_changed+0x80/0xb0
>     frontend_changed+0x14/0x20
>     xenwatch_thread+0x96/0x1a0
>     kthread+0x11d/0x250
>     ret_from_fork+0x29f/0x2d0
>     ret_from_fork_asm+0x1a/0x30
>     </TASK>
> 
> gnttab_unmap_refs_sync() waits for the unmap to complete before it
> returns, so the work never outlives the caller's frame. Initialise it
> with INIT_DELAYED_WORK_ONSTACK() when the item is on the stack and
> destroy it before returning. The function is exported, so an item that
> is not on the stack keeps INIT_DELAYED_WORK().
> 
> Fixes: b44166cd46e2 ("xen/grant: introduce func gnttab_unmap_refs_sync()")
> Signed-off-by: Kavitha Daula <kavi@edera.dev>
Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

       reply	other threads:[~2026-11-09  8:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261105000137.82224-1-kavithadaula@Kavithas-MacBook-Pro.local>
2026-11-09  8:04 ` Juergen Gross [this message]
2026-11-05  0:07 Kavitha Daula

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=7b3fe96c-15f2-4ab8-a818-16974df306ae@suse.com \
    --to=jgross@suse.com \
    --cc=kavi@edera.dev \
    --cc=kavithadaula@Kavithas-MacBook-Pro.local \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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

all inboxes | Powered by JetHome®