Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp952302pxb; Fri, 1 Apr 2022 00:03:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnwVTHveLBpu09w5uRlvhZuQJmFCQ8Zk/TI+BV5mkDMebqBa3Ypd19x6On4oaRTjd9/weB X-Received: by 2002:a17:907:9495:b0:6da:9602:3ec6 with SMTP id dm21-20020a170907949500b006da96023ec6mr8086382ejc.589.1648796586744; Fri, 01 Apr 2022 00:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648796586; cv=none; d=google.com; s=arc-20160816; b=A47FsXY5w9nELJkNbASMHGGJaLpXKwSMwWTQD0KIVi1FkW4PX2s9Dhw+bx1LlphIwu wK/ZZi4qZuQT0Fdg83vujsJTcyT2za5HA3phtovNo7zwsFtnJMqRCAN6bd+s4E35jPiY n2oV2Y0bIMgkw0g6svqTjKMktMKY9LyO11vKefWKxdmawm1c0vJvU/zrJTAavFmCBIxS n7Pc9QJV+zEQWr+sJ3KuetWNNNoYPCCxbNNx5JK26/UgvW0KsrKzkT/TavyNFxG5HmzQ 46/vRiD+joGyVEkg3NVtgukWc5w6BfgKl8dF1tYgBImYEkxX4Or7cbYgGenfWXX9zjVV ZFCQ== 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=f0b47ts2VheeKS+3ncRDbOuaDfRJ+I8108gtQgFa0aM=; b=VdwjHtmgx/ApRHjhEz1WTAM3ddyan/a/vSrmHeq/xRpe030HZlvlVBn5S9UxnedYXl b8GByuP8paUMrTxvYho5RWJDfXOWqxes3o9oNsHwB1Suk/TIIP8gz1wxTIjXlMKEB1h/ iS7Zq2yJb/bKFLsHgXwfYvjE63upP5GiKEDl3Ub3eiKJZ7g4ib1pOWl3C94SOoUTAsLg kbuwTtc4ak1yB+AC3iFnm2fBucMZ9gwHqAeTQxxsQojkQsZsDSafhurTn6eKTU0W0Ppq fjlr+xGB+Gg3tyvxzubm+2+UopmFleCfc8Wtz5FK9xsSXtpbYT5oE8q8hP94xsskzWGu UNhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=LTUp+g4r; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qc6-20020a170906d8a600b006dfa07788cfsi1124812ejb.452.2022.04.01.00.02.40; Fri, 01 Apr 2022 00:03:06 -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=@alien8.de header.s=dkim header.b=LTUp+g4r; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237053AbiCaNyk (ORCPT + 99 others); Thu, 31 Mar 2022 09:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231445AbiCaNyj (ORCPT ); Thu, 31 Mar 2022 09:54:39 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D6E216A70 for ; Thu, 31 Mar 2022 06:52:51 -0700 (PDT) Received: from zn.tnic (p2e55dff8.dip0.t-ipconnect.de [46.85.223.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 877151EC0535; Thu, 31 Mar 2022 15:52:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1648734766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=f0b47ts2VheeKS+3ncRDbOuaDfRJ+I8108gtQgFa0aM=; b=LTUp+g4rs1ac0r9x/TD4H6FmSRcqezk1vUXbkASKLxk9n3Dwb+JcE1jOW3oFj1bpEhuFei AtQJ1OhZuF94JpMgzup2A8m+nbK69gAkatr0QlQ1lsvNgVIshFIEbnfwcdMrn+1f1fIJN8 n+Zf3KtyAVMI5GBQR+Q59kTk5VBX0KI= Date: Thu, 31 Mar 2022 15:52:45 +0200 From: Borislav Petkov To: Marcelo Tosatti Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Matthew Wilcox , Mel Gorman , Nicolas Saenz Julienne , Juri Lelli , Thomas Gleixner , Sebastian Andrzej Siewior , "Paul E. McKenney" Subject: Re: [patch v5] mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu Message-ID: References: <20220304163554.8872fe5d5a9d634f7a2884f5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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, Mar 10, 2022 at 10:22:12AM -0300, Marcelo Tosatti wrote: > > On systems that run FIFO:1 applications that busy loop, > any SCHED_OTHER task that attempts to execute > on such a CPU (such as work threads) will not > be scheduled, which leads to system hangs. > > Commit d479960e44f27e0e52ba31b21740b703c538027c ("mm: disable LRU > pagevec during the migration temporarily") relies on > queueing work items on all online CPUs to ensure visibility > of lru_disable_count. > > To fix this, replace the usage of work items with synchronize_rcu, > which provides the same guarantees. > > Readers of lru_disable_count are protected by either disabling > preemption or rcu_read_lock: > > preempt_disable, local_irq_disable [bh_lru_lock()] > rcu_read_lock [rt_spin_lock CONFIG_PREEMPT_RT] > preempt_disable [local_lock !CONFIG_PREEMPT_RT] > > Since v5.1 kernel, synchronize_rcu() is guaranteed to wait on > preempt_disable() regions of code. So any CPU which sees > lru_disable_count = 0 will have exited the critical > section when synchronize_rcu() returns. > > Signed-off-by: Marcelo Tosatti > Reviewed-by: Nicolas Saenz Julienne > Acked-by: Minchan Kim Someone pointed me at this: https://www.phoronix.com/scan.php?page=news_item&px=Linux-518-Stress-NUMA-Goes-Boom which says this one causes a performance regression with stress-ng's NUMA test... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette