Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 03/30] mm/memcontrol: Add missing annotation for unlock_page_lru()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 04/30] mm/memcontrol: Add missing annotation for lock_page_lru() Jules Irenge
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Johannes Weiner, Michal Hocko,
	Vladimir Davydov, Andrew Morton, cgroups, linux-mm

Sparse reports warning at unlock_page_lry()

warning: context imbalance in unlock_page_lru() - unexpected unlock

The root cause is the missing annotation at unlock_page_lru()
Add the missing __releases(&pgdat->lru_lock)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6f6dc8712e39..22ddd557a69b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2587,6 +2587,7 @@ static void lock_page_lru(struct page *page, int *isolated)
 }
 
 static void unlock_page_lru(struct page *page, int isolated)
+	__releases(&pgdat->lru_lock)
 {
 	pg_data_t *pgdat = page_pgdat(page);
 
-- 
2.24.1



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

* [PATCH 04/30] mm/memcontrol: Add missing annotation for lock_page_lru()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
  2020-02-14 20:47   ` [PATCH 03/30] mm/memcontrol: Add missing annotation for unlock_page_lru() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 05/30] mm/compaction: Add missing annotation for compact_lock_irqsave Jules Irenge
                     ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Johannes Weiner, Michal Hocko,
	Vladimir Davydov, Andrew Morton, cgroups, linux-mm

Sparse reports warning at lock_page_lry()

warning: context imbalance in lock_page_lru() - wrong count at exit

The root cause is the missing annotation at lock_page_lru()
Add the missing __acquires(&pgdat->lru_lock)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 22ddd557a69b..67dc9f1af0bf 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -2571,6 +2571,7 @@ static void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages)
 }
 
 static void lock_page_lru(struct page *page, int *isolated)
+	__acquires(&pgdat->lru_lock)
 {
 	pg_data_t *pgdat = page_pgdat(page);
 
-- 
2.24.1



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

* [PATCH 05/30] mm/compaction: Add missing annotation for compact_lock_irqsave
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
  2020-02-14 20:47   ` [PATCH 03/30] mm/memcontrol: Add missing annotation for unlock_page_lru() Jules Irenge
  2020-02-14 20:47   ` [PATCH 04/30] mm/memcontrol: Add missing annotation for lock_page_lru() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages() Jules Irenge
                     ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: boqun.feng, Jules Irenge, Andrew Morton, linux-mm

Sparse reports a warning at compact_lock_irqsave()

warning: context imbalance in compact_lock_irqsave() - wrong count at exit

The root cause is the missing annotation at compact_lock_irqsave()
Add the missing __acquires(lock) annotation.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/compaction.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index 672d3c78c6ab..81190fe22200 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -481,6 +481,7 @@ static bool test_and_set_skip(struct compact_control *cc, struct page *page,
  */
 static bool compact_lock_irqsave(spinlock_t *lock, unsigned long *flags,
 						struct compact_control *cc)
+	__acquires(lock)
 {
 	/* Track if the lock is contended in async mode */
 	if (cc->mode == MIGRATE_ASYNC && !cc->contended) {
-- 
2.24.1



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

* [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (2 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 05/30] mm/compaction: Add missing annotation for compact_lock_irqsave Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 23:40     ` Mike Kravetz
  2020-02-14 20:47   ` [PATCH 07/30] mm/mempolicy: Add missing annotation for queue_pages_pmd() Jules Irenge
                     ` (6 subsequent siblings)
  10 siblings, 1 reply; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Mike Kravetz, Andrew Morton, linux-mm

Sparse reports a warning at gather_surplus_pages()

warning: context imbalance in hugetlb_cow() - unexpected unlock

The root cause is the missing annotation at gather_surplus_pages()
Add the missing __must_hold(&hugetlb_lock)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/hugetlb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index dd8737a94bec..ff7dda27b33f 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1695,6 +1695,7 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,
  * of size 'delta'.
  */
 static int gather_surplus_pages(struct hstate *h, int delta)
+	__must_hold(&hugetlb_lock)
 {
 	struct list_head surplus_list;
 	struct page *page, *tmp;
-- 
2.24.1



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

* [PATCH 07/30] mm/mempolicy: Add missing annotation for queue_pages_pmd()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (3 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 08/30] mm/slub: Add missing annotation for get_map() Jules Irenge
                     ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: boqun.feng, Jules Irenge, Andrew Morton, linux-mm

Sparse reports a warning at queue_pages_pmd()

context imbalance in queue_pages_pmd() - unexpected unlock

The root cause is the missing annotation at queue_pages_pmd()
Add the missing __releases(ptl)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/mempolicy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 977c641f78cf..bb0755228150 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -442,6 +442,7 @@ static inline bool queue_pages_required(struct page *page,
  */
 static int queue_pages_pmd(pmd_t *pmd, spinlock_t *ptl, unsigned long addr,
 				unsigned long end, struct mm_walk *walk)
+	__releases(ptl)
 {
 	int ret = 0;
 	struct page *page;
-- 
2.24.1



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

* [PATCH 08/30] mm/slub: Add missing annotation for get_map()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (4 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 07/30] mm/mempolicy: Add missing annotation for queue_pages_pmd() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 09/30] mm/slub: Add missing annotation for put_map() Jules Irenge
                     ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Christoph Lameter, Pekka Enberg,
	David Rientjes, Joonsoo Kim, Andrew Morton, linux-mm

Sparse reports a warning at get_map()()

 warning: context imbalance in get_map() - wrong count at exit

The root cause is the missing annotation at get_map()
Add the missing __acquires(&object_map_lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/slub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/slub.c b/mm/slub.c
index 17dc00e33115..3c6d348afcf9 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -449,6 +449,7 @@ static DEFINE_SPINLOCK(object_map_lock);
  * not vanish from under us.
  */
 static unsigned long *get_map(struct kmem_cache *s, struct page *page)
+	__acquires(&object_map_lock)
 {
 	void *p;
 	void *addr = page_address(page);
-- 
2.24.1



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

* [PATCH 09/30] mm/slub: Add missing annotation for put_map()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (5 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 08/30] mm/slub: Add missing annotation for get_map() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 10/30] mm/zsmalloc: Add missing annotation for migrate_read_lock() Jules Irenge
                     ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Christoph Lameter, Pekka Enberg,
	David Rientjes, Joonsoo Kim, Andrew Morton, linux-mm

Sparse reports a warning at put_map()()

 warning: context imbalance in put_map() - unexpected unlock

The root cause is the missing annotation at put_map()
Add the missing __releases(&object_map_lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 3c6d348afcf9..c273d0f32b8f 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -466,7 +466,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page)
 	return object_map;
 }
 
-static void put_map(unsigned long *map)
+static void put_map(unsigned long *map) __releases(&object_map_lock)
 {
 	VM_BUG_ON(map != object_map);
 	lockdep_assert_held(&object_map_lock);
-- 
2.24.1



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

* [PATCH 10/30] mm/zsmalloc: Add missing annotation for migrate_read_lock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (6 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 09/30] mm/slub: Add missing annotation for put_map() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 11/30] mm/zsmalloc: Add missing annotation for migrate_read_unlock() Jules Irenge
                     ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Minchan Kim, Nitin Gupta,
	Sergey Senozhatsky, Andrew Morton, linux-mm

Sparse reports a warning at migrate_read_lock()()

 warning: context imbalance in migrate_read_lock() - wrong count at exit

The root cause is the missing annotation at migrate_read_lock()
Add the missing __acquires(&zspage->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 22d17ecfe7df..da70817b4ed8 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1833,7 +1833,7 @@ static void migrate_lock_init(struct zspage *zspage)
 	rwlock_init(&zspage->lock);
 }
 
-static void migrate_read_lock(struct zspage *zspage)
+static void migrate_read_lock(struct zspage *zspage) __acquires(&zspage->lock)
 {
 	read_lock(&zspage->lock);
 }
-- 
2.24.1



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

* [PATCH 11/30] mm/zsmalloc: Add missing annotation for migrate_read_unlock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (7 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 10/30] mm/zsmalloc: Add missing annotation for migrate_read_lock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 12/30] mm/zsmalloc: Add missing annotation for pin_tag() Jules Irenge
  2020-02-14 20:47   ` [PATCH 13/30] mm/zsmalloc: Add missing annotation for unpin_tag() Jules Irenge
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Minchan Kim, Nitin Gupta,
	Sergey Senozhatsky, Andrew Morton, linux-mm

Sparse reports a warning at migrate_read_unlock()()

 warning: context imbalance in migrate_read_unlock() - unexpected unlock

The root cause is the missing annotation at migrate_read_unlock()
Add the missing __releases(&zspage->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index da70817b4ed8..2eab424c8c67 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1838,7 +1838,7 @@ static void migrate_read_lock(struct zspage *zspage) __acquires(&zspage->lock)
 	read_lock(&zspage->lock);
 }
 
-static void migrate_read_unlock(struct zspage *zspage)
+static void migrate_read_unlock(struct zspage *zspage) __releases(&zspage->lock)
 {
 	read_unlock(&zspage->lock);
 }
-- 
2.24.1



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

* [PATCH 12/30] mm/zsmalloc: Add missing annotation for pin_tag()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (8 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 11/30] mm/zsmalloc: Add missing annotation for migrate_read_unlock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 13/30] mm/zsmalloc: Add missing annotation for unpin_tag() Jules Irenge
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Minchan Kim, Nitin Gupta,
	Sergey Senozhatsky, Andrew Morton, linux-mm

Sparse reports a warning at pin_tag()()

warning: context imbalance in pin_tag() - wrong count at exit

The root cause is the missing annotation at pin_tag()
Add the missing __acquires(bitlock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 2eab424c8c67..7bac76ae11b3 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -891,7 +891,7 @@ static inline int trypin_tag(unsigned long handle)
 	return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle);
 }
 
-static void pin_tag(unsigned long handle)
+static void pin_tag(unsigned long handle) __acquires(bitlock)
 {
 	bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle);
 }
-- 
2.24.1



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

* [PATCH 13/30] mm/zsmalloc: Add missing annotation for unpin_tag()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (9 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 12/30] mm/zsmalloc: Add missing annotation for pin_tag() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  10 siblings, 0 replies; 12+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Minchan Kim, Nitin Gupta,
	Sergey Senozhatsky, Andrew Morton, linux-mm

Sparse reports a warning at unpin_tag()()

warning: context imbalance in unpin_tag() - unexpected unlock

The root cause is the missing annotation at unpin_tag()
Add the missing __releases(bitlock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 7bac76ae11b3..2aa2d524a343 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -896,7 +896,7 @@ static void pin_tag(unsigned long handle) __acquires(bitlock)
 	bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle);
 }
 
-static void unpin_tag(unsigned long handle)
+static void unpin_tag(unsigned long handle) __releases(bitlock)
 {
 	bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle);
 }
-- 
2.24.1



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

* Re: [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages()
  2020-02-14 20:47   ` [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages() Jules Irenge
@ 2020-02-14 23:40     ` Mike Kravetz
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Kravetz @ 2020-02-14 23:40 UTC (permalink / raw)
  To: Jules Irenge, linux-kernel; +Cc: boqun.feng, Andrew Morton, HUGETLB FILESYSTEM

On 2/14/20 12:47 PM, Jules Irenge wrote:
> Sparse reports a warning at gather_surplus_pages()
> 
> warning: context imbalance in hugetlb_cow() - unexpected unlock
> 
> The root cause is the missing annotation at gather_surplus_pages()
> Add the missing __must_hold(&hugetlb_lock)
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz


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

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0/30>
     [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
2020-02-14 20:47   ` [PATCH 03/30] mm/memcontrol: Add missing annotation for unlock_page_lru() Jules Irenge
2020-02-14 20:47   ` [PATCH 04/30] mm/memcontrol: Add missing annotation for lock_page_lru() Jules Irenge
2020-02-14 20:47   ` [PATCH 05/30] mm/compaction: Add missing annotation for compact_lock_irqsave Jules Irenge
2020-02-14 20:47   ` [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages() Jules Irenge
2020-02-14 23:40     ` Mike Kravetz
2020-02-14 20:47   ` [PATCH 07/30] mm/mempolicy: Add missing annotation for queue_pages_pmd() Jules Irenge
2020-02-14 20:47   ` [PATCH 08/30] mm/slub: Add missing annotation for get_map() Jules Irenge
2020-02-14 20:47   ` [PATCH 09/30] mm/slub: Add missing annotation for put_map() Jules Irenge
2020-02-14 20:47   ` [PATCH 10/30] mm/zsmalloc: Add missing annotation for migrate_read_lock() Jules Irenge
2020-02-14 20:47   ` [PATCH 11/30] mm/zsmalloc: Add missing annotation for migrate_read_unlock() Jules Irenge
2020-02-14 20:47   ` [PATCH 12/30] mm/zsmalloc: Add missing annotation for pin_tag() Jules Irenge
2020-02-14 20:47   ` [PATCH 13/30] mm/zsmalloc: Add missing annotation for unpin_tag() Jules Irenge

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git