Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5629908pxb; Mon, 28 Mar 2022 15:12:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtKhuvwPhCK61Le74zfDecxHqs7vcAb7Icx5hWUpCOFHx9fL9JWCNDyoWwmKghq93E7OVJ X-Received: by 2002:a05:6870:2483:b0:dd:af01:2ed2 with SMTP id s3-20020a056870248300b000ddaf012ed2mr674714oaq.178.1648505540642; Mon, 28 Mar 2022 15:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648505540; cv=none; d=google.com; s=arc-20160816; b=yFvbXhp7YQE+0DM4Av11+fHaYKHkv7eJYGeZ1rqTa8xNQqHc9A53vyuUStii4sLlKU gv4RGDT2YwHUSHz4PCRBn6Jbsm7bpUdMupdtncwjNVimi2Nhctc7+zw8RTar+SwFLRz+ 7pqXheRHu+/eRNArXiV2oPjIYGcZ4LCSSllC75O5t1+VpJ4D7JFdOlD4n0OVJFqD8Sim V7RLLYbIRfbFhy80H0RD37YfnCxWlyUHf94PjDVnh5V8llJvSrdqNh1Er5u1lRulg+UL 3hbKngYWCg01gOEj803DttGJMgdAZ8EVlZxxFRcHUr5UFOH7ol6vUTXN132YLd9IZJMB 3UCA== 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:dkim-signature :dkim-signature:date; bh=srXDUoBEUUPdcjFobaF0lZd9YYmN1yFN4+ozvIVJW9Q=; b=slCRLtCVxItI6pBJbX74+wmOursmtEJotFUdMZVAzuqzDj9mospmnZAvnGMq9F9P9T POwt16knmp+7O5ydwCS+pzFz+/Y1MpxcyDGbhy02Obcg+7WTpEqWIF34hJ08CVpzknQw /SRLbD5/BbHCvQzoARdvrksfvYlbRWPtFx38orD3o/ZjAJhyYmN10cRFko0xVUPoDfE1 KTxUxG8Kj0dEUEUJ/jr5VTwMUtbAakr/c+Wr3RJpYVk23k78fRj4TG61ePeeYd1Fa2Bq mhhRt8TfecmNuMg0nSQt1qRTya04bqKwuI5nDpbRWrNIV3vaKE/cBLyJf5zo3bDI5yXB Xp+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Pmt3+lGN; dkim=neutral (no key) header.i=@linutronix.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z14-20020a056870d68e00b000ddac83dfedsi14851089oap.307.2022.03.28.15.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:12:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Pmt3+lGN; dkim=neutral (no key) header.i=@linutronix.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46FA016BFA4; Mon, 28 Mar 2022 14:32:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244124AbiC1RFK (ORCPT + 99 others); Mon, 28 Mar 2022 13:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244065AbiC1RFE (ORCPT ); Mon, 28 Mar 2022 13:05:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0CEF1CB0C for ; Mon, 28 Mar 2022 10:03:23 -0700 (PDT) Date: Mon, 28 Mar 2022 19:03:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1648487002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=srXDUoBEUUPdcjFobaF0lZd9YYmN1yFN4+ozvIVJW9Q=; b=Pmt3+lGNfGL4U0YTB/9h9aYv99clc3rYiHA7ZabaYMzkuWJKFFx3ylcw6dOEPiGFOCtrQi DlXL9WUM7LwG44LngFDeryV4XVBXS0+x9yMQ2pvQ9uusbYiNSS1r7XIgVuGrQDFiCkFl1y ZyvbbX9LHUpei8qjczmufT2LlIRQIJ3kpLIWzzhYG1yj8myub0e0aFNA9GLQuE6r1AR0yb 2V84DiMctksoJZCOf9dA7QXm5UHA9b30EGe8vrh0UTYQI2zmD1oJoUKVo2phd99PYCdmNi ghYt2ElrRwAWIaTpqd1iqfAWYizmIiVIqjVaug/+wOC40Yr8r6kJ8xfZSFRq/g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1648487002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=srXDUoBEUUPdcjFobaF0lZd9YYmN1yFN4+ozvIVJW9Q=; b=SJa/ZKaR8ZxqMtI21QJW2n2ad3znC9T4KW9AInZr/BVGtIWn58oR30ZuTRv8gjHUeFt/aI +vFojVL6CUdQSODA== From: Sebastian Andrzej Siewior To: andrey.konovalov@linux.dev Cc: Andrew Morton , Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vlastimil Babka , Matthew Wilcox , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH] mm, kasan: fix __GFP_BITS_SHIFT definition breaking LOCKDEP Message-ID: References: <462ff52742a1fcc95a69778685737f723ee4dfb3.1648400273.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <462ff52742a1fcc95a69778685737f723ee4dfb3.1648400273.git.andreyknvl@google.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-03-27 19:00:23 [+0200], andrey.konovalov@linux.dev wrote: > From: Andrey Konovalov > > KASAN changes that added new GFP flags mistakenly updated __GFP_BITS_SHIFT > as the total number of GFP bits instead of as a shift used to define > __GFP_BITS_MASK. > > This broke LOCKDEP, as __GFP_BITS_MASK now gets the 25th bit enabled > instead of the 28th for __GFP_NOLOCKDEP. > > Update __GFP_BITS_SHIFT to always count KASAN GFP bits. > > In the future, we could handle all combinations of KASAN and LOCKDEP to > occupy as few bits as possible. For now, we have enough GFP bits to be > inefficient in this quick fix. > > Fixes: 9353ffa6e9e9 ("kasan, page_alloc: allow skipping memory init for HW_TAGS") > Fixes: 53ae233c30a6 ("kasan, page_alloc: allow skipping unpoisoning for HW_TAGS") > Fixes: f49d9c5bb15c ("kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS") > Reported-by: Sebastian Andrzej Siewior > Signed-off-by: Andrey Konovalov Tested-by: Sebastian Andrzej Siewior Sebastian