Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3876314ybl; Mon, 26 Aug 2019 01:51:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+BL80+88JHZl1MxnOYCH5GYJVzIYqpIlxr1+6fOFFVogH9fp9DkJzf7MjzD+38P/vt40x X-Received: by 2002:aa7:8a04:: with SMTP id m4mr18712815pfa.65.1566809472160; Mon, 26 Aug 2019 01:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566809472; cv=none; d=google.com; s=arc-20160816; b=RGOwOSGjQZGdgP1yV5JXPr+cI3XEfUZUGRw1vXHUuQSKdTUOI3l68qepUZY+egT36Z 02rBDAfNd23TZIwXQ47I8707RJI5SK7TWqRaZ16wCPzBb85chazbMTVsViKishfiyPSP 1D+7EUrYLPQM5j/jZJAy0yVRByQLDHdnLKQqLfU6yhFDimDSe+mmTGTXz5B24CXkdzT2 fvkczoVV5mRw7X/9lJq3yjVQrDL6A6NYrJHl7gicm7XEuJ0sRQgTIGCiNNX2VqOL137/ 8jCp1u9l+P7B2kG5AOpQ0cBRrLgELhB5Kb1Pjy5P/Ak3qYrLiPJQCwp6hBJOC0A6AD9U +nWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=Y7ejts7lpiJhlX4+egWDk+iu4dJWOZ7po0kKT0OpMC4=; b=IpNTpLeKj5VQJCOWD7qObsBPI9WrAg7wlLP4xf7NOoo0qSb7HYGR7dxqFP9v7zrzZ4 Ccz9SV+ywM6jIqwbCDy/5k9G3cMBg3hOfElpcfPoBtVjYJVNFs1NQQGJKtWqreDZ0340 hCkmuKuB+dZuboUu1ZlEfEG+jVrP6IUb2y69ygDEqSlX+NA2zGoAPAya4dvn5xikHT2s 3bTTvm1U2iTRIKr0MyhQrDDhYXl6ysb+qHLbueMIp/o2FPhPCDypoDAs0EQL0ZDWkzYD lX6mlg3LKMC+8VMRKs3JtrwtOPlR3aHMvrkxOI4GOiM5oUIjeVLd7zGdBDF4ZPB6DfFC kjhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=ZVQN0C0X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k192si8527743pge.222.2019.08.26.01.50.56; Mon, 26 Aug 2019 01:51:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=ZVQN0C0X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730375AbfHZIjy (ORCPT + 99 others); Mon, 26 Aug 2019 04:39:54 -0400 Received: from forwardcorp1j.mail.yandex.net ([5.45.199.163]:42262 "EHLO forwardcorp1j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729523AbfHZIjx (ORCPT ); Mon, 26 Aug 2019 04:39:53 -0400 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1j.mail.yandex.net (Yandex) with ESMTP id 3B9232E045B; Mon, 26 Aug 2019 11:39:51 +0300 (MSK) Received: from smtpcorp1p.mail.yandex.net (smtpcorp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:10]) by mxbackcorp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kPAtGJAWjF-doPiv6Rx; Mon, 26 Aug 2019 11:39:51 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1566808791; bh=Y7ejts7lpiJhlX4+egWDk+iu4dJWOZ7po0kKT0OpMC4=; h=In-Reply-To:References:Date:Message-ID:From:To:Subject; b=ZVQN0C0X7bfLpqONhnIcbXCciPSnf0ZQe87EOzqxF7ubpJcjvtoTJmY+Jof+wIqia PEaE9w9ENQcqOpxatGvjD0TmDLw+9EItjqMz8obWXNyoLfUEk2Nq2/ckAr+NthoGs5 cCPwE+ZAbNG9qfRqLLqgDRWz23KdHvzmNr8zZToU= Authentication-Results: mxbackcorp2j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:f558:a2a9:365e:6e19]) by smtpcorp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id n5aJDOHkZi-doBieEVh; Mon, 26 Aug 2019 11:39:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: [PATCH 00/14] per memcg lru_lock To: Daniel Jordan , Alex Shi , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mel Gorman , Tejun Heo , Michal Hocko , Hugh Dickins References: <1566294517-86418-1-git-send-email-alex.shi@linux.alibaba.com> <6ba1ffb0-fce0-c590-c373-7cbc516dbebd@oracle.com> <348495d2-b558-fdfd-a411-89c75d4a9c78@linux.alibaba.com> From: Konstantin Khlebnikov Message-ID: Date: Mon, 26 Aug 2019 11:39:49 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/08/2019 18.20, Daniel Jordan wrote: > On 8/22/19 7:56 AM, Alex Shi wrote: >> 在 2019/8/22 上午2:00, Daniel Jordan 写道: >>>    https://git.kernel.org/pub/scm/linux/kernel/git/wfg/vm-scalability.git/tree/case-lru-file-readtwice> >>> It's also synthetic but it stresses lru_lock more than just anon alloc/free.  It hits the page activate path, which is where we see this >>> lock in our database, and if enough memory is configured lru_lock also gets stressed during reclaim, similar to [1]. >> >> Thanks for the sharing, this patchset can not help the [1] case, since it's just relief the per container lock contention now. > > I should've been clearer.  [1] is meant as an example of someone suffering from lru_lock during reclaim.  Wouldn't your series help > per-memcg reclaim? > >> Yes, readtwice case could be more sensitive for this lru_lock changes in containers. I may try to use it in container with some tuning. >> But anyway, aim9 is also pretty good to show the problem and solutions. :) >>> >>> It'd be better though, as Michal suggests, to use the real workload that's causing problems.  Where are you seeing contention? >> >> We repeatly create or delete a lot of different containers according to servers load/usage, so normal workload could cause lots of pages >> alloc/remove. > > I think numbers from that scenario would help your case. > >> aim9 could reflect part of scenarios. I don't know the DB scenario yet. > > We see it during DB shutdown when each DB process frees its memory (zap_pte_range -> mark_page_accessed).  But that's a different thing, > clearly Not This Series. > >>>> With this patch series, lruvec->lru_lock show no contentions >>>>           &(&lruvec->lru_l...          8          0               0       0               0               0 >>>> >>>> and aim9 page_test/brk_test performance increased 5%~50%. >>> >>> Where does the 50% number come in?  The numbers below seem to only show ~4% boost. >>After splitting lru-locks present per-cpu page-vectors works no so well because they mixes pages from different cgroups. pagevec_lru_move_fn and friends need better implementation: either sorting pages or splitting vectores in per-lruvec basis. >> the Setddev/CoeffVar case has about 50% performance increase. one of container's mmtests result as following: >> >> Stddev    page_test      245.15 (   0.00%)      189.29 (  22.79%) >> Stddev    brk_test      1258.60 (   0.00%)      629.16 (  50.01%) >> CoeffVar  page_test        0.71 (   0.00%)        0.53 (  26.05%) >> CoeffVar  brk_test         1.32 (   0.00%)        0.64 (  51.14%) > > Aha.  50% decrease in stdev. > After splitting lru-locks present per-cpu page-vectors works no so well because they mix pages from different cgroups. pagevec_lru_move_fn and friends need better implementation: either sorting pages or splitting vectores in per-lruvec basis.