Skip to content

Commit e904c2c

Browse files
songmuchuntorvalds
authored andcommitted
mm: mmap_lock: fix disabling preemption directly
Commit 832b507 ("mm: mmap_lock: use local locks instead of disabling preemption") fixed a bug by using local locks. But commit d01079f ("mm/mmap_lock: remove dead code for !CONFIG_TRACING configurations") changed those lines back to the original version. I guess it was introduced by fixing conflicts. Link: https://lkml.kernel.org/r/20210720074228.76342-1-songmuchun@bytedance.com Fixes: d01079f ("mm/mmap_lock: remove dead code for !CONFIG_TRACING configurations") Signed-off-by: Muchun Song <songmuchun@bytedance.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> Reviewed-by: Yang Shi <shy828301@gmail.com> Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent af64237 commit e904c2c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mm/mmap_lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ static inline void put_memcg_path_buf(void)
156156
#define TRACE_MMAP_LOCK_EVENT(type, mm, ...) \
157157
do { \
158158
const char *memcg_path; \
159-
preempt_disable(); \
159+
local_lock(&memcg_paths.lock); \
160160
memcg_path = get_mm_memcg_path(mm); \
161161
trace_mmap_lock_##type(mm, \
162162
memcg_path != NULL ? memcg_path : "", \
163163
##__VA_ARGS__); \
164164
if (likely(memcg_path != NULL)) \
165165
put_memcg_path_buf(); \
166-
preempt_enable(); \
166+
local_unlock(&memcg_paths.lock); \
167167
} while (0)
168168

169169
#else /* !CONFIG_MEMCG */

0 commit comments

Comments
 (0)