Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp140000iof; Sun, 5 Jun 2022 23:34:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6zX4IPc5LHWxux1oyyXob/EN91mI25MIy+3bPt3zNmH5eCl4uwWChp+VZthZL4+o0VwLr X-Received: by 2002:a63:1359:0:b0:3fd:a384:d69c with SMTP id 25-20020a631359000000b003fda384d69cmr5068030pgt.289.1654497247949; Sun, 05 Jun 2022 23:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654497247; cv=none; d=google.com; s=arc-20160816; b=NmpMv/3txK/KMIzWs6VNR+iIqdz6k2L33TYTYubKXFCG4hqC76r0dtPQbsKwRj3RG3 IiCNZfj1BZ38f2XtLpfiwzKH+E6wBxrFV+iNZrbI48xB/nG5P6juXjojWCJzgT7rgGyC ylic2z2EsoLXQwdEDMQtbsy+OsBoYqswj5pbRvjg324kKwy5J1NnMlPHN2LJ13FdZS3B 8YYiKhBh6jM6Cl/Tszrbo6gBTxWAxXdFKSurBTSa8DUVgBOJvCpfqK/WPbe4JV3pcMGR Q6rvyJWeqCce6zMqQorboUadQcXk3JPPTPbsoiKhsFAvZfUVTCZsRVvlGj0iLfB/8KWA nJzg== 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=PU/wtFgbFJ2hVCAW9E7cT8/yEnByR5CyDAOKu9Po3Kk=; b=r8McLOMaDxl82Y1aIb50Phz4aEI0xF1PcNOOvr1r1wpVLmv7XYqX0+uOgz3YOJrooU h66b77thtRPQTff597z0CXUZDw27i18KrrS2JB3m0uRLfyaFTKGMXrFOWTMSAqD43FbF nWqJjlWHsGvB9fGnz/jazZiC/4GN9unacqITW7yPFYxwg6vpd07lDWCxO/yTPfHI4PQj KRa80mIs2qnsFAZGrYZ+p7lWby+QyB9L/nS0+Adng88s+EbV3KkCP5IpXWimyYtJwj// xoeFNP4MdwXwnT2ovTfKIiUPSny7BNu47LKo58OJsTu06iKNUmMGTuWHf4E2XFSP/zVX cZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NlJfS7pq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s10-20020a63770a000000b00381ff256f5esi19266792pgc.551.2022.06.05.23.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:34:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NlJfS7pq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1EDBDDF1F; Sun, 5 Jun 2022 22:43:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbiFFFnU (ORCPT + 99 others); Mon, 6 Jun 2022 01:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiFFFnS (ORCPT ); Mon, 6 Jun 2022 01:43:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6811BF72 for ; Sun, 5 Jun 2022 22:43:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 48E3FB80F9B for ; Mon, 6 Jun 2022 05:43:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A6B3C385A9; Mon, 6 Jun 2022 05:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654494193; bh=7Zp038j/zSkCCliFc52iUh2W+hvLb5xcunWPvnZKqZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NlJfS7pqw5Vj0h3oBGFxII1TnA8vLIVvBi/TO/L0Sk+hBosZvqJTp3JmHRB0ao3q5 zguX60SMunn+IZBBtK8IrrgzWJ6fakiypiER/GWdeDesgPI9d4cbta8a+TG4AhWio0 TQhNqcd2HKhMCHT5ulBIjo0ASpGYzxVqt2XpYA6s= Date: Mon, 6 Jun 2022 07:43:11 +0200 From: Greg KH To: Duoming Zhou Cc: linux-staging@lists.linux.dev, davem@davemloft.net, kuba@kernel.org, alexander.deucher@amd.com, broonie@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback Message-ID: References: <20220520061541.14785-1-duoming@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520061541.14785-1-duoming@zju.edu.cn> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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=unavailable 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 Fri, May 20, 2022 at 02:15:41PM +0800, Duoming Zhou wrote: > There are sleep in atomic context bugs when dm_fsync_timer_callback is > executing. The root cause is that the memory allocation functions with > GFP_KERNEL parameter are called in dm_fsync_timer_callback which is a > timer handler. The call paths that could trigger bugs are shown below: > > (interrupt context) > dm_fsync_timer_callback > write_nic_byte > kzalloc(sizeof(data), GFP_KERNEL); //may sleep > write_nic_dword > kzalloc(sizeof(data), GFP_KERNEL); //may sleep > > This patch changes allocation mode from GFP_KERNEL to GFP_ATOMIC > in order to prevent atomic context sleeping. The GFP_ATOMIC flag > makes memory allocation operation could be used in atomic context. > > Signed-off-by: Duoming Zhou What commit id does this fix? And how did you find this issue? Did you run the code to verify it still works properly? thanks, greg k-h