From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCB2AECAAA1 for ; Fri, 28 Oct 2022 13:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230296AbiJ1N74 (ORCPT ); Fri, 28 Oct 2022 09:59:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiJ1N7w (ORCPT ); Fri, 28 Oct 2022 09:59:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1775DEC6 for ; Fri, 28 Oct 2022 06:59:51 -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 9BC97B82A79 for ; Fri, 28 Oct 2022 13:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C4ADC433D6; Fri, 28 Oct 2022 13:59:48 +0000 (UTC) Date: Fri, 28 Oct 2022 14:59:44 +0100 From: Catalin Marinas To: Waiman Long Cc: Andrew Morton , 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: References: <20221020175619.366317-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221020175619.366317-1-longman@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 20, 2022 at 01:56:19PM -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. > > Signed-off-by: Waiman Long Acked-by: Catalin Marinas