Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1842506rwi; Thu, 20 Oct 2022 18:36:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4HpKi23hmbfi52s2d+SwevVkBeuoU2KHhVMtT4RC+kbFboiIYCe4twt8/c0EXgO+rSQW57 X-Received: by 2002:a63:90c4:0:b0:45f:c571:67eb with SMTP id a187-20020a6390c4000000b0045fc57167ebmr13691494pge.541.1666316183247; Thu, 20 Oct 2022 18:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666316183; cv=none; d=google.com; s=arc-20160816; b=uwd9zYa2BjBkr7beGlI5e9ONihCfdwZr4AH7FzW3aACxsiI+kFlR3BE15NMA1mAmOt tcj7hHjBan+WF0R8Bw0iIhw3OUba+iH3ySwhhx9DCefIKJJJXyRIMX8/Y4G4HFeySW0i firHwwB0MvnnNHWVunSFNq1F/CMpd8x0G1+BIjMeU1I3Y5pFKQhxNIZwj+K7+T0TN452 2qRA2iBNefFll3YgrdjSoAAq/Zut9v+G/c3tIC/ks7UybxxDw+X7zaVvYjbdtg7FqeJo ryugzc6xexVVd1JUlvfzFW63vwseSF7i9ghaPOqevE0XEaD0qmfAmdW6Pj0smAIzob9F BXhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=k1JOtaOwit3RThqn5+yoeckyMOxnET87YmzzLhBFga0=; b=KlfdzudbQJKRC4GyLrV2CEWDLN3trmhWTvsWoZ7bP5UhXrw7D2Lgs71Dtz74H1TcHS RW9GDUyybVOgeApXek23qqTgEYrPebD5JLML1pl/RnBF4DJZP6HQt88koeglioUe+MFy oe9PJjmU/LUcq+axsRJHVG3057ktmLet99Ht6hhF/95oL7UffHnyDHnlR0ITpl+zBgVa ljYe3RlbhWWeV/+B1tLaVkfImLMNhMEsZ471QGkp5gCgHfzF6F108i4whdNHHwf+oEpc j42/XtF5OsTOtR3RTfxg3U2p8qnI9B+GZUbI/YFP5YITglR+uEwz7hW4OuXWZVuJ9YFL qIQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=DZDARGIg; 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 l4-20020a170902d04400b001783c12fb4fsi20159217pll.208.2022.10.20.18.36.10; Thu, 20 Oct 2022 18:36:23 -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=@linux-foundation.org header.s=korg header.b=DZDARGIg; 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 S229928AbiJUA6a (ORCPT + 99 others); Thu, 20 Oct 2022 20:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiJUA61 (ORCPT ); Thu, 20 Oct 2022 20:58:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0385D1A16C2 for ; Thu, 20 Oct 2022 17:58:27 -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 8CA34B82A04 for ; Fri, 21 Oct 2022 00:58:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 166E8C433C1; Fri, 21 Oct 2022 00:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1666313904; bh=5yLhVCUhBQBePRY5NTY6Rawpef5GL4cx0onubKzHul4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DZDARGIgcLQ6LqDsLARjMxK9nxiMXV5WHH0hBOJJzwWjm3/Al8CwMwv+HAhatnX7q fS1JKZxzuEGDdFYzC2ByKgJyEGA080ILJ7Waxl+hjhMTUmb7/6Zrnk6l2VuJNWE67D 3t+wF0NiXcwjoyrPIE5H6UNEVr+yXQm2SD237KJw= Date: Thu, 20 Oct 2022 17:58:23 -0700 From: Andrew Morton To: Waiman Long Cc: Catalin Marinas , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: Re: [PATCH] mm/kmemleak: Prevent soft lockup in kmemleak_scan()'s object iteration loops Message-Id: <20221020175823.d7aa5cfeefd8673429f42081@linux-foundation.org> In-Reply-To: <20221020175619.366317-1-longman@redhat.com> References: <20221020175619.366317-1-longman@redhat.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Thu, 20 Oct 2022 13:56:19 -0400 Waiman Long wrote: > Commit 6edda04ccc7c ("mm/kmemleak: prevent soft lockup in first object > iteration loop of kmemleak_scan()") adds cond_resched() in the first > object iteration loop of kmemleak_scan(). However, it turns that the > 2nd objection iteration loop can still cause soft lockup to happen in > some cases. So add a cond_resched() call in the 2nd and 3rd loops as > well to prevent that and for completeness. > Seems reasonable, although not an object of beauty. We didn't include a Fixes: or cc:stable in 6edda04ccc7c, even though it addresses softlockups. I think I'll add a cc:stable to this, with a Fixes:6edda04ccc7c. So any kenrel which included 6edda04ccc7c will hopefully add this as well.