Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp900479lqb; Wed, 17 Apr 2024 14:19:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoSi+bVX/JrHaA2aASIxCNc/FIowdpHerP/cbLxYshHx+LpRdtLdthNNjMM5ZSOOkzTsLVW3HKDJHUXrApHsLC+OZVqNyhMuiHeqxNqQ== X-Google-Smtp-Source: AGHT+IGl2opXo+tXVyD54P+N4R6hs+5Q28cP/RV24FCDZ1nmkBR1K5a/dg5Gz+DFTyoz7OwTPZ82 X-Received: by 2002:a17:902:d2c5:b0:1e8:7906:5be3 with SMTP id n5-20020a170902d2c500b001e879065be3mr73321plc.18.1713388755794; Wed, 17 Apr 2024 14:19:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713388755; cv=pass; d=google.com; s=arc-20160816; b=k0HwpJe2ETR7pZUCh63mlr8Rgtm2qgGCA8CBYQ08/vTrisg77syrkUMDi7bc++Sj9X GGQlL+jpSbD6mfTNDCIof32OLW6imMVFKWPuwoI7OxaZEqQKJTp3fghnYeT7hxBvmBP2 LB1lmEwT2wMU+YfZ5vBbrY/UCSfPCdfPc7Qiu3n0S6u1ZuQGdBX+hiIoLS76fEHrnayW m5l0yzcLtdOc+zWJzPjQhFV6B0OkU4uaPElBntHFjSQdKtfrAqQjRtm66MoWK5yuoN02 y8DKrW31mldPxHLLP/wqFkyPG3YeSvY+vqZTdDCVQRgKwl6ybZ7rLmVhlOq4qhpI4pr0 UMkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RODytP55S9PjZjf+7gfJJ4x6mavqXkgxb7Ks2uWHAe4=; fh=gP/JPAyslJMDUK7U6QxIb3fM9zr68NwHwX5tUaHTAE0=; b=B2WEwRgj2OZZU0HVT6ZR/Fe82l2yHt4C3/+mu00WbL8A37lspfKA+zq2TEE5m19HdL FLscbg+u9MfgKqKpUT+SXdLtVuC5URsrwTMy2uxLdyViXwOarhCKh+pwk/cxMO7MWZ67 Qcr+XKkUGXwBFdu8q0V1Rb2zJEZsEADHcABMIyKGgSCmPJz7vQGkhsORn9D4bVmJo2O4 Go5ORTVpRWxIt+01C+VDGCLrh8j4z7Evo2ESOsO7v9f26uXe8FW1vjeVXqv1DFvA+Eab QzrGQZHDL7Dn7bKd9J8hKXAkdVS+9BEmZ+5wPe8gvn7c1KqXpt1WRmF34PcpkgsFY50K oQdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y6RV5IiZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-149246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v21-20020a170902e8d500b001e7a2ab237esi94467plg.423.2024.04.17.14.19.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 14:19:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y6RV5IiZ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-149246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E7A82B2156D for ; Wed, 17 Apr 2024 21:19:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 085804C63D; Wed, 17 Apr 2024 21:18:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y6RV5IiZ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FD224AEED for ; Wed, 17 Apr 2024 21:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713388727; cv=none; b=lH0jH8RTiAPqdAm+08d8XRCqrhClUxUUFm8a4hEuvPUqeBFERe3nOqoX5BnTHVTlhCGnqoE22Zb3C2HdjxPqxRieJcSpRUZCrDbA3IhUlTA6mwIM3Wj+m1i01WhcwIF3qJKBKFCu16rkcv5j1l2NylHFQAjr8Kkegbx7ZAXUTkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713388727; c=relaxed/simple; bh=9JKcMI1ryyQZw1audDUIy9GcPT5/GaGd6txUjiGLFg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pgNA9/8GmFMszxGEoza7C39icNr02mg2J4w27JrhnsxoFR5ryD4IlL7QTTpRjmyXhBC+HVGp1ftGjWfcxoVy7dT5aojbktxmJWhIBn0GXJZ1e2avS1VM+iJHby36qFD66e8j0Ss/KnMR6VVAMZfONejdil/C8T1TTsapwSJZdhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Y6RV5IiZ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713388724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RODytP55S9PjZjf+7gfJJ4x6mavqXkgxb7Ks2uWHAe4=; b=Y6RV5IiZJf8iJXCNjwb7chcbUandb0LSxINYveJMniJj4cTnSAJy6rP18K1mZEnbmURUob PfH9P8RBKVj5H3PdDHX1IV+1REF1eVZRMtugXOeNFomtkINQx/cW8mlpQEQyp9mb7zTYaZ eia1U+1VqZpbpPB52mdJtjqgfDU9Jaw= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-376-ka3Ow4UfPPeELgAN0YHo-A-1; Wed, 17 Apr 2024 17:18:42 -0400 X-MC-Unique: ka3Ow4UfPPeELgAN0YHo-A-1 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-6ea10c8093eso18782a34.1 for ; Wed, 17 Apr 2024 14:18:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713388722; x=1713993522; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RODytP55S9PjZjf+7gfJJ4x6mavqXkgxb7Ks2uWHAe4=; b=Iw7T/Fvyc2JEU0Mon6P/jKsckzY0urH/bYJ8/5IMDRgB+Rl5x3ijlOlXXbVF2toyp4 KyKoyQhd8wQxaquHS7FU7xBJwwgxkOPbLHjFYL/Yy7WSY4UjX9kIql6YccwTRyrq/OP3 ZiTB+tAcMF0hP9v+p69Lpd2gfiW82fzYZzF7KWuEecT/qPl0TdaYeFRwZKFSyOlkPlA9 jhu0DkLu6fKDPuCFlJrmT67WYIl1IgQpJRgUqEm0n8ZCgbdu2pTSMlkW/hnEqcvVYm+q RYycIn/pkV9eFpy/lXptvW9JzvIud01PJpj0n19+opHN0cxQHQx8MfKg3TPKS+vFqHtR 2/mw== X-Forwarded-Encrypted: i=1; AJvYcCUS1sInwgtQ9eAZh2b7jbKjh7++0pxhC2JlF/NHdnLVXb9qVvzaU1yNR/H7kV8T9F/OzLuo+0RzYXkYMD2rsR9vOHUN5pW09mmnidKk X-Gm-Message-State: AOJu0YyY8h6FuP7OtBJUzDw2I6TuP324jpzqjrbTunZJsxDudqiJfwxk vA1MDH3B575bJAWkpYWuwsV/VMKL2J4kZ4U4Yu14RzFxLyN1Bd1ZLdVdzl4czpR1cwHoF5akxNY YrgKpKVZ9SBVIn/q8nVXQQmOjQ6auK9gl91Us3sDtbRfoEQJxwaPxtH/YsI83fw== X-Received: by 2002:a9d:7406:0:b0:6eb:7e33:3fbb with SMTP id n6-20020a9d7406000000b006eb7e333fbbmr838906otk.0.1713388722117; Wed, 17 Apr 2024 14:18:42 -0700 (PDT) X-Received: by 2002:a9d:7406:0:b0:6eb:7e33:3fbb with SMTP id n6-20020a9d7406000000b006eb7e333fbbmr838884otk.0.1713388721661; Wed, 17 Apr 2024 14:18:41 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id c10-20020a37e10a000000b0078d667d1085sm18692qkm.84.2024.04.17.14.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 14:18:41 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: peterx@redhat.com, David Hildenbrand , Mina Almasry , Andrew Morton , Muchun Song , David Rientjes Subject: [PATCH 3/3] mm/hugetlb: Assert hugetlb_lock in __hugetlb_cgroup_commit_charge Date: Wed, 17 Apr 2024 17:18:36 -0400 Message-ID: <20240417211836.2742593-4-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240417211836.2742593-1-peterx@redhat.com> References: <20240417211836.2742593-1-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is similar to __hugetlb_cgroup_uncharge_folio() where it relies on holding hugetlb_lock. Add the similar assertion like the other one, since it looks like such things may help some day. Signed-off-by: Peter Xu --- mm/hugetlb_cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index aa4486bd3904..e20339a346b9 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -308,7 +308,7 @@ static void __hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, { if (hugetlb_cgroup_disabled() || !h_cg) return; - + lockdep_assert_held(&hugetlb_lock); __set_hugetlb_cgroup(folio, h_cg, rsvd); if (!rsvd) { unsigned long usage = -- 2.44.0