linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] mm: replace vma->vm_flags direct modifications with modifier calls
@ 2023-07-11  7:21 Dan Carpenter
  2023-07-11 21:55 ` Suren Baghdasaryan
  0 siblings, 1 reply; 18+ messages in thread
From: Dan Carpenter @ 2023-07-11  7:21 UTC (permalink / raw)
  To: surenb; +Cc: linux-mm

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-07-18 16:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11  7:21 [bug report] mm: replace vma->vm_flags direct modifications with modifier calls Dan Carpenter
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).