Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2166155ybv; Fri, 14 Feb 2020 12:49:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzocBd8//6vxeNQVTQ6J7eGfmugtnFYWEllgfJxlXpVja3nLEEjtYYsqdvMR4czeAL0CtSj X-Received: by 2002:aca:503:: with SMTP id 3mr3215489oif.106.1581713355770; Fri, 14 Feb 2020 12:49:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581713355; cv=none; d=google.com; s=arc-20160816; b=I2ctBISovzmsG30YnTmw9bIwM12TKouziB1ePFW5rFHgIhBLkEIqBuQQGM4AUHA0Ys Vx8/zAjGjKU8D7B4c+4tE1kgdcGIE5wRHOTakd67UtjVgAY8kadFzNdzMaq6B4POkWfa flykFQ/LZBveI1XXsIEwLyqxk8LMxejyTjeGHm4eBfF31iiy0yQ6UWRC/ZX1+gAvxobX vsZaehehz0tNHyy6qtOXWHuB98THXIpp1rz+n/t1v8Vf2jIhg1TK0xZrBqYOZl5b8M19 i+88vjTbhvTh8yxm0JDQk3yWJaH2EN7mE8vgflYxGg0CttlSMN19RiUaTWV018fzUHGY dXDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LSZn5NdxipyK46DzNeA7V4/WUx7AG4S+aIA7f0L3pf4=; b=dTqGcM72MHFTOrzY4lx3igC5PdH3RVryRQ2uiEaYcnwOWfZqAUy4CH3muAWPf7WzbV VBfLO0zYqOjdUZQZcxrSaQSgm1B/mp71B2iVW5OdUsiN71pV+GK3YeDLdnxVkil8Tfwa ChY8IHzbsvrpfE0ru3NE1MkZ9pR6jKDlv7XN4/2oA8tm6fbm1Lf7n+HUDjsI+1pm7+3e U94VxSMJWDSqOqGrNZeP0VX3N5IeJ+5vigEm+B4sGMdDsEOVV4TWR37p9XmLL8TanZwv 6bLFM/OqAfzb4SM4+NhVzxuhmrfs6V9PzZbjIBlK48DIzf42ewOTKnmi8GZwOS9xxh1Y rXLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pquNABTb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si3299261otl.133.2020.02.14.12.49.03; Fri, 14 Feb 2020 12:49:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pquNABTb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387863AbgBNUsl (ORCPT + 99 others); Fri, 14 Feb 2020 15:48:41 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44510 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387607AbgBNUsk (ORCPT ); Fri, 14 Feb 2020 15:48:40 -0500 Received: by mail-wr1-f68.google.com with SMTP id m16so12435809wrx.11 for ; Fri, 14 Feb 2020 12:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LSZn5NdxipyK46DzNeA7V4/WUx7AG4S+aIA7f0L3pf4=; b=pquNABTbsXNyaQ+/83nJLxQ70MTTj+Ewj/CNGpjT6V7tfvLRAasRwqSCJCxKtiKqM+ HaZYCtQxabHgj8vYaQY95EbRzY8d5cJjm3ZhIxeEgTdercVlU1F1qyOaY3L7CNLAgWtI TDPAnfTZpohKtMnzqv1Ru4XPswjCcLnChGIZW82GzFY5/m57E504kaWZ1CLGeF9Txyqy CipZTnKRVjrayd/ofaYAZQtro360dBR+sg1lwNahtOJ5ciKFxsHYxomydjOgDJ6RhLOd QgVcKurbgPZG9v7pvgGGSzNAgjWYFXJfo3teqMhWQSDz+eg5z0FSkegos220VsUqHxno 6ghQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LSZn5NdxipyK46DzNeA7V4/WUx7AG4S+aIA7f0L3pf4=; b=Ob0igqZqG/ChTFAggfHPNzRYG9ykJnm9smpEx+drwJ9UwGJTn+NsvJJDGAKUmzYMGa 8dmdTH8hf9vCK9A1SIs+ho3f2pYw8BMXokLJMwJob9RiKEjwHd2vTmhLFYP3QO7pJ51P 9U/TLg67P4fO4XvM6N7TqK6YxAqo5DpmGFui20cecN9SWOt70FeqsjJlk2Wv3PBVG4I1 yOxMmpVD0dIbM+puzxKUD25Ltbd/5niEsGljomrm9BcotfzGy9DGt1OzQErH7V+/DWPG fxOxDFakfy8ZDCogIkMGLum6b9WriCbGCoBHojs2Ir7gtQfH1zqwXeNwfz83o7eiBm28 vbOQ== X-Gm-Message-State: APjAAAXpTw97g4ssPLZRtkiIZhU5sFcHzZcnXpZk+98ReHEFP7E+E9fR XVnRLKMlQ14ySv6/YyAqfT/n9nFXi5Fc X-Received: by 2002:a5d:5742:: with SMTP id q2mr1794014wrw.145.1581713319098; Fri, 14 Feb 2020 12:48:39 -0800 (PST) Received: from ninjahost.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id y12sm8660782wmj.6.2020.02.14.12.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 12:48:38 -0800 (PST) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: boqun.feng@gmail.com, Jules Irenge , Mike Kravetz , Andrew Morton , linux-mm@kvack.org (open list:HUGETLB FILESYSTEM) Subject: [PATCH 06/30] mm/hugetlb: Add missing annotation for gather_surplus_pages() Date: Fri, 14 Feb 2020 20:47:17 +0000 Message-Id: <20200214204741.94112-7-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200214204741.94112-1-jbi.octave@gmail.com> References: <0/30> <20200214204741.94112-1-jbi.octave@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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