Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp981050pxb; Thu, 24 Mar 2022 10:23:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzESOo7vZnLn4I/FqVUf1mikUvAvUnHUxMES2qwDn6RbVbLjpADFSghztiu77hTyFq81lW0 X-Received: by 2002:a17:903:2292:b0:154:5350:bdf0 with SMTP id b18-20020a170903229200b001545350bdf0mr6918068plh.62.1648142632801; Thu, 24 Mar 2022 10:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648142632; cv=none; d=google.com; s=arc-20160816; b=fma95uAmCxbjpggnoNTGJ7n/sppPthxm73R83/EkDtvjHpFCudAeO+acf2LnBPR63h rFN2W+abvbwA9TgdK0gGkPfEmxldVFz7gf7vkbU+QYbXkCp3u5YSC3MArX16yyBv6lPS 7pS8X2mTYGgrXPYM67piOqSqCgrTApbKEd6tbt5AG+HbKQrIOltpSD6nvSqevHwuvfBu EDRwjRRlDN7KLI+W/KPLQTSeXWteFYE/39L3clDXRoni756hAkEedV/tPItPV2ujj/up CZnBgZ0N8S+KZ1HbVJppt0wygFH/zoKz4aB36e0MHFi7oxLEH+xY43fbTd6AIjtlGVpW Ynpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=skAPDzFpHTiodgB8Q02pBrdUfjbG2DP3aT/OV2kUCTg=; b=qlPYa6euhg9e1ivknlHSojHNdlEq3jwkkLalvhQSnAQMdkngRY4Qq7hRMa79rgya1l MMyUGU3uFSruMMsUrtsVx3HNUHhr/b4ZdG3lnhcMPCKCFKX9Y/d/g1oQ1igSdbuQBez4 utnYdJb+JInsjhbUrtBoARYknNkJ8FgoDfYKLm4B0ovjK3dPbQU6b33WYaxgDzrlJTZK jsNcm0k8E/r/Iavv/jkSBsRJAnWDgu7BHGqRP78vg+IITivUxCOT2HMC2kiM3QLWZWPm U205aIUS3ygePuAk74OpzH94X/sbosOQpmyE/qzSv/3t4jtO2bG144Vhn3uq6zad8wWw IOBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ExWKBH5g; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=xJJQhmlp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a637011000000b003816043ef55si22035182pgc.330.2022.03.24.10.23.38; Thu, 24 Mar 2022 10:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ExWKBH5g; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=xJJQhmlp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232977AbiCWNVF (ORCPT + 99 others); Wed, 23 Mar 2022 09:21:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244202AbiCWNVB (ORCPT ); Wed, 23 Mar 2022 09:21:01 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 492FD1FCE6 for ; Wed, 23 Mar 2022 06:19:32 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E2EBE1F37F; Wed, 23 Mar 2022 13:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648041570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=skAPDzFpHTiodgB8Q02pBrdUfjbG2DP3aT/OV2kUCTg=; b=ExWKBH5gbebZ2qLYLYhoqyuTeCoOFEeTDXcHTyKzVTsy7cEJjCYK6VddO3UW7yGD+ja2Cu SrZnNBg0QIK1yZsSQPDEIxkQ45o4i57nTrErjU5qicqaZABRbr95w4AvNZ3e9QyzZnujTs nm7tAt0Q1y8Sf0+UfJEtEENErmnZCco= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648041570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=skAPDzFpHTiodgB8Q02pBrdUfjbG2DP3aT/OV2kUCTg=; b=xJJQhmlpXwoElCRd9f8SJOA1NqCjyl8IfEx5JKFWYW8GBDuHAdGI+N76EUs5DvqbMFysNf vQk/tHT2uqjB5mDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6F60C12FC5; Wed, 23 Mar 2022 13:19:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ud/kGWIeO2KkJgAAMHmgww (envelope-from ); Wed, 23 Mar 2022 13:19:30 +0000 Message-ID: <93851312-6443-31ec-c194-8117e483f5d4@suse.cz> Date: Wed, 23 Mar 2022 14:19:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v6 27/39] kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS Content-Language: en-US To: Sebastian Andrzej Siewior Cc: andrey.konovalov@linux.dev, Andrew Morton , Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov References: <44e5738a584c11801b2b8f1231898918efc8634a.1643047180.git.andreyknvl@google.com> <63704e10-18cf-9a82-cffb-052c6046ba7d@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 3/23/22 14:02, Sebastian Andrzej Siewior wrote: > On 2022-03-23 12:48:29 [+0100], Vlastimil Babka wrote: >>> +#ifdef CONFIG_KASAN_HW_TAGS >>> #define ___GFP_SKIP_KASAN_POISON 0x1000000u >>> +#else >>> +#define ___GFP_SKIP_KASAN_POISON 0 >>> +#endif >>> #ifdef CONFIG_LOCKDEP >>> #define ___GFP_NOLOCKDEP 0x2000000u >>> #else >>> @@ -251,7 +255,9 @@ struct vm_area_struct; >>> #define __GFP_NOLOCKDEP ((__force gfp_t)___GFP_NOLOCKDEP) >>> >>> /* Room for N __GFP_FOO bits */ >>> -#define __GFP_BITS_SHIFT (25 + IS_ENABLED(CONFIG_LOCKDEP)) >>> +#define __GFP_BITS_SHIFT (24 + \ >>> + IS_ENABLED(CONFIG_KASAN_HW_TAGS) + \ >>> + IS_ENABLED(CONFIG_LOCKDEP)) >> >> This breaks __GFP_NOLOCKDEP, see: >> https://lore.kernel.org/all/YjoJ4CzB3yfWSV1F@linutronix.de/ > > This could work because ___GFP_NOLOCKDEP is still 0x2000000u. In Hm but already this patch makes gfp_allowed_mask to be 0x1ffffff (thus not covering 0x2000000u) when CONFIG_LOCKDEP is enabled and the KASAN stuff not? 0x8000000u is just even further away. > ("kasan, page_alloc: allow skipping memory init for HW_TAGS") > https://lore.kernel.org/all/0d53efeff345de7d708e0baa0d8829167772521e.1643047180.git.andreyknvl@google.com/ > > This is replaced with 0x8000000u which breaks lockdep. > > Sebastian >