Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp966840iob; Fri, 13 May 2022 18:00:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIPyNsqfrsv15Yp7BB690PojyoHoo4AgTd57wsV/JNyFjFxkyRFDhZu7rozjx777FT2VhR X-Received: by 2002:a5d:68c6:0:b0:20a:d654:6cae with SMTP id p6-20020a5d68c6000000b0020ad6546caemr5831060wrw.564.1652490049974; Fri, 13 May 2022 18:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652490049; cv=none; d=google.com; s=arc-20160816; b=mm6aj832vNijYd37GWzYV3Xi93xO0ljJUtqVzPRKqhYf2JAcWY3a1tg+EudJIAc7bG dyoAIZiyNX4rEHKIeAHWju8c0I/Sfam8x6BK0JDpqhWEEeOqFsdy2pj4mGxry+cniHIL 7JP3zKifQEBOMK35ZGjBnqpThjfvxaWSgf5skpyF5YRpXHy2REKuNEkPgy6dpKR593ye LSAbjmQAAPhp58buRmWqZERc7MehQ5/X+caheBUYbfjpu7PPVX5V6Ay9TuAuEafjZbuA 380dCwUA2TVOQW+tBUpHuTIV0/2BFu5UgtnLCh5yi7YWblj1TWo/kQIaa+cdbayUZkvW Jq+w== 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=5yxis9EQxjU0dz8SXP3XOX9JD9iDbEiof4nu3RFIoLk=; b=I9qabcDTN8eEAWLIRIBbYdai+aI3xRY3pnwm6tAgwVI1PVdn3nIc9dZyjp2jHEv/v2 t5pQyG4+ZeYFVu5Kv449nkGeU4KUezmPiMQhsOk7JZJQIw0Bdt6qbATVtquiFnCkhvve T+PyvECLDifMGNp4cyPYFKeJd3hMpw5jjgzL6LbF3NOFI0RnD8HV8BTUqY9eR1NjeYsC aBn6uOdFWt/igX9+xe9sn43kKeawpKKU42Jpg5TnlskD4fsX+4tJ7J7tgUTbJgjI1NyW jTb9w7XolDViTUc2pxGJjWRiIO86/fTxbdYkimguOPXDwzlmnHZPPEPQSMlDNqbjcKUD wIng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=rmovmyUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x1-20020adff641000000b002060fa0598bsi3652768wrp.156.2022.05.13.18.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=rmovmyUL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E31543669F2; Fri, 13 May 2022 16:34:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358163AbiELTnj (ORCPT + 99 others); Thu, 12 May 2022 15:43:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbiELTnd (ORCPT ); Thu, 12 May 2022 15:43:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9186C6D85B for ; Thu, 12 May 2022 12:43:29 -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 31EE2B82800 for ; Thu, 12 May 2022 19:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A752C385B8; Thu, 12 May 2022 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652384606; bh=svto5GyU8taVOq/ATPulnnBJz3xd5M+rVyqe8CVebaw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rmovmyUL2offJz3vXskJXddvVytBjSxNCLtWsO6g2RLrlV+XxBLp8YuD3TY7BdnC1 j3YDo1fpVzkwlPVbFntxtw96yGrdnSVpijkj5BGVy04pmFlG7Z63VIdW5963smAJP5 qcC6to713PORGitmpKXz45Cn0itVlYWlmKdaN5XM= Date: Thu, 12 May 2022 12:43:25 -0700 From: Andrew Morton To: Mel Gorman Cc: Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , LKML , Linux-MM Subject: Re: [PATCH 0/6] Drain remote per-cpu directly v3 Message-Id: <20220512124325.751781bb88ceef5c37ca653e@linux-foundation.org> In-Reply-To: <20220512085043.5234-1-mgorman@techsingularity.net> References: <20220512085043.5234-1-mgorman@techsingularity.net> 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=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 12 May 2022 09:50:37 +0100 Mel Gorman wrote: > Changelog since v2 > o More conversions from page->lru to page->[pcp_list|buddy_list] > o Additional test results in changelogs > > Changelog since v1 > o Fix unsafe RT locking scheme > o Use spin_trylock on UP PREEMPT_RT > > This series has the same intent as Nicolas' series "mm/page_alloc: Remote > per-cpu lists drain support" -- avoid interference of a high priority > task due to a workqueue item draining per-cpu page lists. While many > workloads can tolerate a brief interruption, it may be cause a real-time s/may be/may/ > task runnning on a NOHZ_FULL CPU to miss a deadline and at minimum, s/nnn/nn/ > the draining in non-deterministic. s/n/s/;) > Currently an IRQ-safe local_lock protects the page allocator per-cpu lists. > The local_lock on its own prevents migration and the IRQ disabling protects > from corruption due to an interrupt arriving while a page allocation is > in progress. The locking is inherently unsafe for remote access unless > the CPU is hot-removed. I don't understand the final sentence here. Which CPU and why does hot-removing it make the locking safe? > This series adjusts the locking. A spinlock is added to struct > per_cpu_pages to protect the list contents while local_lock_irq continues > to prevent migration and IRQ reentry. This allows a remote CPU to safely > drain a remote per-cpu list. > > This series is a partial series. Follow-on work should allow the > local_irq_save to be converted to a local_irq to avoid IRQs being > disabled/enabled in most cases. Consequently, there are some TODO comments > highlighting the places that would change if local_irq was used. However, > there are enough corner cases that it deserves a series on its own > separated by one kernel release and the priority right now is to avoid > interference of high priority tasks.