From: Dan Carpenter <dan.carpenter@linaro.org>
To: surenb@google.com
Cc: linux-mm@kvack.org
Subject: [bug report] mm: replace vma->vm_flags direct modifications with modifier calls
Date: Tue, 11 Jul 2023 10:21:26 +0300 [thread overview]
Message-ID: <9704a138-60e6-4ede-91f0-844e1df2ad84@moroto.mountain> (raw)
Hello Suren Baghdasaryan,
The patch 1c71222e5f23: "mm: replace vma->vm_flags direct
modifications with modifier calls" from Jan 26, 2023, leads to the
following Smatch static checker warning:
./include/linux/mm.h:729 vma_start_write()
warn: sleeping in atomic context
include/linux/mm.h
722 static inline void vma_start_write(struct vm_area_struct *vma)
723 {
724 int mm_lock_seq;
725
726 if (__is_vma_write_locked(vma, &mm_lock_seq))
727 return;
728
--> 729 down_write(&vma->vm_lock->lock);
730 vma->vm_lock_seq = mm_lock_seq;
731 up_write(&vma->vm_lock->lock);
732 }
The call tree is:
gru_fault() <- disables preempt
-> remap_pfn_range()
-> track_pfn_remap()
-> remap_pfn_range_notrack()
-> vm_flags_set()
-> vma_start_write()
Before track_pfn_remap() and remap_pfn_range_notrack() would just do |=
to set the flags but now they use vm_flags_set() so there is a potential
they could sleep.
regards,
dan carpenter
next reply other threads:[~2023-07-11 7:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 7:21 Dan Carpenter [this message]
2023-07-11 21:55 ` Suren Baghdasaryan
2023-07-11 22:21 ` Matthew Wilcox
2023-07-11 23:45 ` Suren Baghdasaryan
2023-07-12 7:35 ` David Hildenbrand
2023-07-12 15:01 ` Suren Baghdasaryan
2023-07-12 15:52 ` Matthew Wilcox
2023-07-12 15:55 ` David Hildenbrand
2023-07-12 16:03 ` Suren Baghdasaryan
2023-07-12 18:49 ` Matthew Wilcox
2023-07-12 18:52 ` David Hildenbrand
2023-07-12 19:48 ` Suren Baghdasaryan
2023-07-17 6:13 ` Yan Zhao
2023-07-17 16:18 ` Suren Baghdasaryan
2023-07-18 0:27 ` Yan Zhao
2023-07-18 16:27 ` Suren Baghdasaryan
2023-07-12 19:34 ` Matthew Wilcox
2023-07-17 19:54 ` Dimitri Sivanich
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=9704a138-60e6-4ede-91f0-844e1df2ad84@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=linux-mm@kvack.org \
--cc=surenb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox