Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp529267rwb; Mon, 26 Sep 2022 02:18:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dhaIfvVHRVRyxonHWDiw22Oc6yTGyYtbGxPJIdC1DS6catzmfRVM70xGKN4FnPJVWctWz X-Received: by 2002:a17:902:d2d2:b0:178:a68:f40f with SMTP id n18-20020a170902d2d200b001780a68f40fmr21127199plc.149.1664183913445; Mon, 26 Sep 2022 02:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664183913; cv=none; d=google.com; s=arc-20160816; b=nOsyGLh3TIDm9291CJew/04qxlWsOrigqrj8J6XLqXI1w5TgKDfdb/VBfhtlP4StEh 697xfwMegwATHvQ60WTJZw+A96x3f23/jpQ5Eq0k4BThJ52GUCcz85wblBpH+6r4n89X 4y2DCEvXg17bdkscS5FIKwaFf5KHU+UvDDc80aV2Q56Iwcc4LApazEDkDkniQu43v1td /FyeucQ2Bz8MWHtKH7RlElGvKkA2PX1dH4Ogj+JF1Fl5TMBxNNpsZ6quvDveo2mGOEOD 5auCOevgDsuITeOU1Vf9Olpie2+hnIZR5mcgUthOUlNutAqQG74idH8ftZdEZ02qYPQ7 8ihw== 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=3Lb/jC5elVDHJVD4iZP6e8+D+hP4jLe4mPHbNOrwg2Y=; b=PsczpLJAL6LWbDuV8kPSdWLL80//YOMk/cywcbEquK2Ag8ljh+E4q6TkPAMpsSuiNH 73PqsYNNR0Zv+wbYDPtF6Wmb9XzchTQPBcj44FoW/1EEKL9EQD2LXWXmISjMUb/M2Crn 8uApYaZvRKV9d7CyOU9CNfxf3l7dFrO/YH4MfD7kgIDCiqv0iOaJ4aRmgGgbUE4vvv/d Ek3OtJEHPRY2WxlP5oZPvae5g8DGFWjJ7xRdIXRogeNHmFyDQNgLlCCkwGlgue1qwbp9 E7DB5/azqVvYlC6gNvRqZ6wNRU72G4FtA2HPjp4wNQhA9iwvEeSPEJN1n9s2uxC+yq4+ 2OmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=JWX1NuBw; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a17090301ca00b00176ae70d99csi13238650plh.31.2022.09.26.02.18.21; Mon, 26 Sep 2022 02:18:33 -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.com header.s=susede1 header.b=JWX1NuBw; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234587AbiIZI7S (ORCPT + 99 others); Mon, 26 Sep 2022 04:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233554AbiIZI7P (ORCPT ); Mon, 26 Sep 2022 04:59:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD14F3DBC4; Mon, 26 Sep 2022 01:59:14 -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-out1.suse.de (Postfix) with ESMTPS id 82E8421D36; Mon, 26 Sep 2022 08:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1664182753; h=from:from:reply-to: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=3Lb/jC5elVDHJVD4iZP6e8+D+hP4jLe4mPHbNOrwg2Y=; b=JWX1NuBwi+fFMrBUtA0Zb00NPb6CAYHpzM7/2hIUs7ghzr2e04MTjoo/o5YivNBSfp3bBZ q/4mPhv/F1b3+VLD0Nkp0Pf5n0sCJPNs5UqkIs8bv2cwDP7ewF/2IeXJLn3EG8gZWcjR6Y 7NEqZSEI6NUVBN9wNUrFFKZyvWhFRLg= 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 620A913486; Mon, 26 Sep 2022 08:59:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id R7icFeFpMWNCZwAAMHmgww (envelope-from ); Mon, 26 Sep 2022 08:59:13 +0000 Date: Mon, 26 Sep 2022 10:59:12 +0200 From: Michal Hocko To: Florian Westphal Cc: netdev@vger.kernel.org, tgraf@suug.ch, urezki@gmail.com, Paolo Abeni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Martin Zaharinov , Paolo Bonzini , kvm@vger.kernel.org Subject: Re: [PATCH net] rhashtable: fix crash due to mm api change Message-ID: References: <20220926083139.48069-1-fw@strlen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926083139.48069-1-fw@strlen.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Mon 26-09-22 10:31:39, Florian Westphal wrote: > Martin Zaharinov reports BUG() in mm land for 5.19.10 kernel: > kernel BUG at mm/vmalloc.c:2437! > invalid opcode: 0000 [#1] SMP > CPU: 28 PID: 0 Comm: swapper/28 Tainted: G W O 5.19.9 #1 > [..] > RIP: 0010:__get_vm_area_node+0x120/0x130 > __vmalloc_node_range+0x96/0x1e0 > kvmalloc_node+0x92/0xb0 > bucket_table_alloc.isra.0+0x47/0x140 > rhashtable_try_insert+0x3a4/0x440 > rhashtable_insert_slow+0x1b/0x30 > [..] > > bucket_table_alloc uses kvzalloc(GPF_ATOMIC). If kmalloc fails, this now > falls through to vmalloc and hits code paths that assume GFP_KERNEL. > > I sent a patch to restore GFP_ATOMIC support in kvmalloc but mm > maintainers rejected it. > > This patch is partial revert of > commit 93f976b5190d ("lib/rhashtable: simplify bucket_table_alloc()"), > to avoid kvmalloc for ATOMIC case. > > As kvmalloc doesn't warn when used with ATOMIC, kernel will only crash > once vmalloc fallback occurs, so we may see more crashes in other areas > in the future. > > Most other callers seem ok but kvm_mmu_topup_memory_cache looks like it > might be affected by the same breakage, so Cc kvm@. > > Reported-by: Martin Zaharinov > Fixes: a421ef303008 ("mm: allow !GFP_KERNEL allocations for kvmalloc") > Link: https://lore.kernel.org/linux-mm/Yy3MS2uhSgjF47dy@pc636/T/#t > Cc: Michal Hocko > Cc: Paolo Bonzini > Cc: kvm@vger.kernel.org > Signed-off-by: Florian Westphal Please continue in the original email thread until we sort out the most reasonable solution for this. -- Michal Hocko SUSE Labs