public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: david@redhat.com
Cc: virtualization@lists.linux-foundation.org
Subject: [bug report] virtio-mem: use page_offline_(start|end) when setting PageOffline()
Date: Wed, 25 Aug 2021 12:40:53 +0300	[thread overview]
Message-ID: <20210825094053.GA31594@kili> (raw)

Hello David Hildenbrand,

The patch 6cc26d77613a: "virtio-mem: use page_offline_(start|end)
when setting PageOffline()" from Jun 30, 2021, leads to the following
Smatch static checker warning:

	drivers/virtio/virtio_mem.c:1072 virtio_mem_set_fake_offline()
	warn: sleeping in atomic context

drivers/virtio/virtio_mem.c
    1069 static void virtio_mem_set_fake_offline(unsigned long pfn,
    1070 					unsigned long nr_pages, bool onlined)
    1071 {
--> 1072 	page_offline_begin();

virtio_mem_online_page_cb() is holding rcu_read_lock() so calling
page_offline_begin() here is sleeping in atomic bug.

    1073 	for (; nr_pages--; pfn++) {
    1074 		struct page *page = pfn_to_page(pfn);
    1075 
    1076 		__SetPageOffline(page);
    1077 		if (!onlined) {
    1078 			SetPageDirty(page);
    1079 			/* FIXME: remove after cleanups */
    1080 			ClearPageReserved(page);
    1081 		}
    1082 	}
    1083 	page_offline_end();
    1084 }

regards,
dan carpenter
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

             reply	other threads:[~2021-08-25  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  9:40 Dan Carpenter [this message]
2021-08-25  9:56 ` [bug report] virtio-mem: use page_offline_(start|end) when setting PageOffline() David Hildenbrand

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=20210825094053.GA31594@kili \
    --to=dan.carpenter@oracle.com \
    --cc=david@redhat.com \
    --cc=virtualization@lists.linux-foundation.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