Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1686873pxb; Thu, 7 Oct 2021 12:54:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3feu32ypq4ShCrKta7Mn/q7BwjGUsUtHQ/lLNGNMloQRb+TKRdl/0K2+hSSne5DBT32uv X-Received: by 2002:a63:1e5a:: with SMTP id p26mr1252788pgm.0.1633636482320; Thu, 07 Oct 2021 12:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633636482; cv=none; d=google.com; s=arc-20160816; b=VuRELPeWqQszsrkWQpK/ab6B/30OPHnyF0Qkc3a3gqxYmvaDeYDrNfKHwKCrSK1uwi ytQhWdjjag5bbPa6wTm3iH/DcR9cjm+5qED9kxbs/1LoMF2n/wJXvBdSj2NjAowe4bjx 0ZiZKEBoCbZjeD8Xc1yT6xdWpJZyfyTHImYzctvadnXItianH83FEjpcUwYg4RHsrGdh 06eBRcFYMaOf9DdwR121vHS6lN8nqtlKITlFbdeNPwPmQG7g9T9qpce40VIKmlRokI0G FfT/beyUputO93i5T6ie5xmXq2SmAaZkPF6EgU/zzqT6V3HHjkgXQdC0qXX4tpHhJYrK 5r5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5ov7Y3AdM9RNZqm8EP9Y9K5HZHbQg0Tk3kW4wZrNisU=; b=ihO+8c7F6cTw5BEC7JAuBeyVtoC/l3p6YW1nl5NyqDc/TmHuA+ejCcCURIJchtuF+i I/S+uLpbD8Wo8C/WVXR0vfnuICrdOCDqS6HcD7nd11S0yvGVsoEirTvtYkzdQGrFyUKz WwDC6y7HbuwNobEYJIBsgpPp6ktEXcpvvGeHfEmYMlUpum6C7SNHTiMXSojkdEuoKYgp gnaHtZDPQWspbWEYy5ELIA6sV96/88T3Z5YgB6RwpUF5rOr8XwuCL9iyOmzf3MSiyo0x VljAmF3MhFO9nc56ou07w8XylISMIyzQXu2qJFqgPt/kYStOctZe5IBmCLoeW2MpqjC/ z8GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="wIKTf0/X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i37si195905pgi.494.2021.10.07.12.54.29; Thu, 07 Oct 2021 12:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="wIKTf0/X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233328AbhJGTdc (ORCPT + 99 others); Thu, 7 Oct 2021 15:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232829AbhJGTda (ORCPT ); Thu, 7 Oct 2021 15:33:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C50C061570; Thu, 7 Oct 2021 12:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5ov7Y3AdM9RNZqm8EP9Y9K5HZHbQg0Tk3kW4wZrNisU=; b=wIKTf0/Xx58Dcd+75FXYhO6TpO wOvrjbzdXRPaGAIp1B1H3BfnXW/D/XaSolWgQH7tlfq4Jkqz+w13NdPhBwQa3QV/yChIvCwtXUxso llNdNzLEvCd44R612N2acyNWet3H8LjMs4GXuI1A2tSElqgflZNgdsKHJ9XbDW2BOTjlqUTFANF/A 3vFjuUiA3Dau1FUjzThJ9z2w3yu8YuEnDod1RVht3dwOmgeVVFr7NLtIiP2prd4UiHnbjBwuMK6m+ udsyXpFpBz7v7cN55kp3uNmjx6cn+wVK4eXBw7osEDLtkQe3jsdQosqK70vT1MqP0CV/diU2dGLLh qpAYb5kQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYZ5t-002MV4-KT; Thu, 07 Oct 2021 19:30:32 +0000 Date: Thu, 7 Oct 2021 20:30:17 +0100 From: Matthew Wilcox To: Anders Roxell Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, viresh.kumar@linaro.org Subject: Re: [RFC PATCH] fs: proc: task_mmu: fix sparse warnings Message-ID: References: <20211007191636.541041-1-anders.roxell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211007191636.541041-1-anders.roxell@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 07, 2021 at 09:16:36PM +0200, Anders Roxell wrote: > When building the kernel with sparse enabled 'C=1' the following > warnings can be seen: > > fs/proc/task_mmu.c:587:17: warning: context imbalance in 'smaps_pte_range' - unexpected unlock > fs/proc/task_mmu.c:1145:28: warning: context imbalance in 'clear_refs_pte_range' - unexpected unlock > fs/proc/task_mmu.c:1473:28: warning: context imbalance in 'pagemap_pmd_range' - unexpected unlock > fs/proc/task_mmu.c:1811:28: warning: context imbalance in 'gather_pte_stats' - unexpected unlock > > Rework to add __acquire() and __release() to tell sparse that it is all good. Surely the root problem here is that pmd_trans_huge_lock() isn't marked with __cond_lock() like, eg, get_locked_pte() is?