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 0A7B9C433F5 for ; Thu, 10 Mar 2022 03:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239272AbiCJDax (ORCPT ); Wed, 9 Mar 2022 22:30:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231621AbiCJDat (ORCPT ); Wed, 9 Mar 2022 22:30:49 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 107C012A741 for ; Wed, 9 Mar 2022 19:29:49 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 56B3A610AB for ; Thu, 10 Mar 2022 03:29:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85CF6C340E8; Thu, 10 Mar 2022 03:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1646882988; bh=Y3t4lV1jIoKGK4m2yMyigJhYuqSRKau7FAkkcqBIRb0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TGA/6LQtGGREJgckJiJnRD6BRW/t2sHNz8Y9nex10J6D2Jza2f3UDYQNwFE2OQnQt QxC9JUuYQ7NTU7yHY3QfCnp0l/AAzP02c8DDweQlbhE98WqTAEn3gDRHYaZcpMY4hB YPtYY8xQHe5TB2TluBh/+11jrp8Iel64ITQ1S8Cs= Date: Wed, 9 Mar 2022 19:29:47 -0800 From: Andrew Morton To: wangjianxing Cc: Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, vbabka@suse.cz Subject: Re: [PATCH 1/1] mm/page_alloc: add scheduling point to free_unref_page_list Message-Id: <20220309192947.0b4c8c875c492de09c1ab632@linux-foundation.org> In-Reply-To: <3713cb82-9596-9916-9830-c2827d6a6fe4@loongson.cn> References: <20220302013825.2290315-1-wangjianxing@loongson.cn> <20220309170517.05facf4a2d183cc9aac9196d@linux-foundation.org> <3713cb82-9596-9916-9830-c2827d6a6fe4@loongson.cn> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Mar 2022 10:48:41 +0800 wangjianxing = wrote: > spin_lock will preempt_disable(), interrupt context will=20 > __irq_enter/local_bh_disable and also add preempt count with offset. >=20 > cond_resched check whether if preempt_count =3D=3D 0 in first and won't=20 > schedule in previous context. >=20 > Is this right? >=20 >=20 > With another way, could we add some condition to avoid call cond_resched= =20 > in interrupt context or spin_lock()? >=20 > + if (preemptible()) > +=A0=A0 =A0=A0=A0 cond_resched(); >=20 None of this works with CONFIG_PREEMPTION=3Dn.