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 AE6F6C433F5 for ; Fri, 26 Nov 2021 10:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347904AbhKZKvr (ORCPT ); Fri, 26 Nov 2021 05:51:47 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:33162 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231164AbhKZKtn (ORCPT ); Fri, 26 Nov 2021 05:49:43 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8E47A2191E; Fri, 26 Nov 2021 10:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1637923589; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9YdYQ/QDOZ9ujDOWQAlnJ0DA9EtWFPO4uXJDqWq55J8=; b=CVDzatEG+gWBqlCmhrJjzygJY+XwRfcK07I1UtlWI05DnbvL1DSrHPfAElyHrj4Ycr6QLt uweguk+nnzzfJjyGyX81qA8AH9BSS1VPauDyTa30l3lJwy/s1pSZdWw2tGzHPKs7ughFGJ wnne3H49SvTo+whWmQGnMAY12Krwf2E= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 77507A3B84; Fri, 26 Nov 2021 10:46:29 +0000 (UTC) Date: Fri, 26 Nov 2021 11:46:29 +0100 From: Michal Hocko To: Hao Lee Cc: Matthew Wilcox , Linux MM , Johannes Weiner , vdavydov.dev@gmail.com, Shakeel Butt , cgroups@vger.kernel.org, LKML Subject: Re: [PATCH] mm: reduce spinlock contention in release_pages() Message-ID: References: <20211124151915.GA6163@haolee.io> <20211125080238.GA7356@haolee.io> <20211125123133.GA7758@haolee.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 26-11-21 14:50:44, Hao Lee wrote: > On Thu, Nov 25, 2021 at 10:18 PM Michal Hocko wrote: [...] > > Could you share more about requirements for those? Why is unmapping in > > any of their hot paths which really require low latencies? Because as > > long as unmapping requires a shared resource - like lru lock - then you > > have a bottle necks. > > We deploy best-effort (BE) jobs (e.g. bigdata, machine learning) and > latency-critical (LC) jobs (e.g. map navigation, payments services) on the > same servers to improve resource utilization. The running time of BE jobs are > very short, but its memory consumption is large, and these jobs will run > periodically. The LC jobs are long-run services and are sensitive to delays > because jitters may cause customer churn. Have you tried to isolate those workloads by memory cgroups? That could help for lru lock at least. You are likely going to hit other locks on the way though. E.g. zone lock in the page allocator but that might be less problematic in the end. If you isolate your long running services to a different NUMA node then you can get even less interaction. > If a batch of BE jobs are finished simultaneously, lots of memory are freed, > and spinlock contentions happen. BE jobs don't care about these contentions, > but contentions cause them to spend more time in kernel mode, and thus, LC > jobs running on the same cpu cores will be delayed and jitters occur. (The > kernel preemption is disabled on our servers, and we try not to separate > LC/BE using cpuset in order to achieve "complete mixture deployment"). Then > LC services people will complain about the poor service stability. This > scenario has occurred several times, so we want to find a way to avoid it. It will be hard and a constant fight to get reasonably low latencies on a non preemptible kernel. It would likely be better to partition CPUs between latency sensitive and BE jobs. I can see how that might not be really practical but especially with non-preemptible kernels you have a large space for priority inversions that is hard to forsee or contain. -- Michal Hocko SUSE Labs