Skip to content

Commit

Permalink
mm/compaction: add missing annotation for compact_lock_irqsave
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
irenge authored and torvalds committed Apr 7, 2020
1 parent bb8b93b commit 77337ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 77337ed

Please sign in to comment.