Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2457826rwi; Fri, 28 Oct 2022 07:19:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ShyAqhUtQA2BKruKUublIi9rcQwq3NcdQtrLQEdOjmQ080+ZlclTtJp9hOKYK8iKeERtC X-Received: by 2002:a17:90a:6d22:b0:213:7e1e:9be0 with SMTP id z31-20020a17090a6d2200b002137e1e9be0mr7580483pjj.17.1666966770413; Fri, 28 Oct 2022 07:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666966770; cv=none; d=google.com; s=arc-20160816; b=q8v9/4jUZTFIvHWY7rcepiYya6J/SiOYN8H17aN/7GiNXWVZ95lh5FthhU8gWPof7h yzVKySQYbGaHzCwyhOgsrXMEnelYMLLhtqSXZToTLA7gQVR+g9pi8JQIz7AKvO1stlqL TXAhw4DbB0rtaKKsWbnIc4QdLDJwDDATGXfa/FR0NGPdx1K3DoevTD7EXugD5TS3EcXf V4JwbM1fucVRxu1FdKeiCmRrkulEuxFBVmO9mVHXhligU7ENY/FYB0vb6PnbGSVF/aRA wqDNiTGlzA/uyS5Bmuj9+K5bjupjXcRTmdWgh7P6YkEgARsjEvAdaXAJlxfjl6xl41uY iyVA== 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; bh=KTVnEOniSlE7pMIiT0llRsAY6ZF5kejQBu7gdgG2oPs=; b=jMgi4mzX7wY2p/2Ebz0F4JCDqr9yprxIMJSkyY3ZGSX8g/svM60wSH6LhHoZBZ2uMa GY5YQv/BEPJrjNbtp9NS+nKxmjbkTdMeTJRttiZbdlNuksmsvxS0oUaeicqlFejaw48T LvlnbQC56heL/v3RCjLOd+3ZaH/v+UWL7BCWpi0ys2MTQk07aL3hy2/Kovo81YeeLuYa y+/e/wyCR5s26NxaaL3C+2qqXT9y1LnnY5ke0rm7bnXJ74weL4zmoTJvMOJe270OdTbj LBoVbjUGRn9UjKfstsFCWktmaTSWGa0YNZkX/+M0w79oR9A0LII3MVr8ITVIdx8//hnI +ihw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ms19-20020a17090b235300b00211e0e9f18csi5103579pjb.40.2022.10.28.07.19.16; Fri, 28 Oct 2022 07:19:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbiJ1N7z (ORCPT + 99 others); Fri, 28 Oct 2022 09:59:55 -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> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 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