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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD13EC61D9B for ; Wed, 22 Nov 2023 14:29:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F0FC6B0620; Wed, 22 Nov 2023 09:29:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A1436B0621; Wed, 22 Nov 2023 09:29:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 390246B0622; Wed, 22 Nov 2023 09:29:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 25CE06B0620 for ; Wed, 22 Nov 2023 09:29:14 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E207D40C8B for ; Wed, 22 Nov 2023 14:29:13 +0000 (UTC) X-FDA: 81485822586.03.77AA887 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) by imf29.hostedemail.com (Postfix) with ESMTP id EC8A512001D for ; Wed, 22 Nov 2023 14:29:10 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=aYIjIGbN; spf=pass (imf29.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.178 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700663351; a=rsa-sha256; cv=none; b=bBaVHD/pxQW6O6qWwFg7dKN2mv5J+en2x3+xWpLYl7bcsdPCT41m4sj9+xUV7heb5D2Gl7 1/gDI9OhjMbqVXxxoZJGVVrfzmXnN8beVAaz3mxx2eDshKFbnywi+Drmk1OEm3gYdGUuVb DNl3KzooBnmEr19Vh1duwou+LH4JIyw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=aYIjIGbN; spf=pass (imf29.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.178 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700663351; h=from:from:sender: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=99YWFglF0T2/aZDMEN9bhlwnnr/AzORzK0PTg/nUzUE=; b=NaG8eZ1HN4ppCJcjqzHurugSIa4BrdKEDeAqoiLS2c6A7++X5T2IW6pea3V1c40SZLwhyr T124t9gggSi4BxVqS1Mmcya0L4fbyW7vuYOkxytDOVWIagAZfD/xS786+L0BJh9NUrpMEL zzsRobHR79d9Fymf+lfFh+58I7Sndso= Message-ID: <325f38f2-1c09-49a0-a882-d1818c2312ae@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700663348; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=99YWFglF0T2/aZDMEN9bhlwnnr/AzORzK0PTg/nUzUE=; b=aYIjIGbN3SLSa2Gq5v9ENCwkTbACZV+mwdLroaKJZGwwO0wU3sqTtLoZznGbA6HpgatXvg drDvvQBfLzB9Up75jk1CtDbS99WArG4FvvWlFxMgi5AmB7Umj3ZW1N/DWbXR2MKASeMuoK jU1gfaIhSf9nWqMjJ0DFy8PkMfkYwJg= Date: Wed, 22 Nov 2023 22:28:37 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v5 6/9] slub: Delay freezing of partial slabs Content-Language: en-US To: Vlastimil Babka , Mark Brown Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chengming Zhou , Matthew Wilcox References: <20231102032330.1036151-1-chengming.zhou@linux.dev> <20231102032330.1036151-7-chengming.zhou@linux.dev> <4f3bc1bd-ea87-465d-b58a-0ed57b15187b@sirena.org.uk> <83ff4b9e-94f1-8b35-1233-3dd414ea4dfe@suse.cz> <4ebc67be-8286-17e9-da33-225ed75509a6@suse.cz> <2af8c92f-0de8-4528-af43-6c6e8c1ebdf3@linux.dev> <42867716-5d3d-0252-5fd2-0f8b62498523@suse.cz> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <42867716-5d3d-0252-5fd2-0f8b62498523@suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: EC8A512001D X-Stat-Signature: ke8cmoempehppz4kxkqbnd48sydkumqq X-Rspam-User: X-HE-Tag: 1700663350-171663 X-HE-Meta: U2FsdGVkX1+5RY5uFasdurV14e+kCly4uQhDg6NWIltdllDzGHfw8/Z0R9YgFp/selWQa4i4QLUYGQb8ZdmXeDgWikgcvU196Q4o0CoMnFs4Fi7HcLTTtrLGu0PIHxcjdyN++TjywBdJTrU9ClLqQkqnvHZXPYOFe7rAwr9COANZFjE4DoCkU1J1g9t4FixUslXFzin8H+9s7ylKWPUlISRCHgA//KOen3NC2VFoK8cUbyB5WXPWeSwDNDvVb5NL4NacKHVuBGQBCtJ5SvNVoHa0BLTI3ut9EbdY9doUktnYF/5tF4bijoois9Z+AjPfDIprSvbYj3SK604RIQeq2+W+o0HtKok9Yn1Ni/A6ulHZTraxGLUBwUmxcdF9V4cTkluihAL++rOF1mm+5iOEinjTm4uZl8Fd5Z4onMADOEhXF7uavoO6+dimPX/uJLbzG2+4wpLdhWRjXc7wm8n3G0lWRZXVD8h+SLRINUTGXAgoxx/V56tYkhptyKiAbHSa9aUsB1L6C6UE8knYeViSEWac2xmoEhFG2O0nzEGvlp1rskKkK5oJ9L8qwzRqgTHv62L6zayPkOeCkjFtsngrJZDJ4rypavhfgXXV3+XdK3Smck94RHIVPBK19gZdM/E86mLLen/Cn2z2MGw3cixWTjFG7NhbM8OKzKODCtVZT2VvYWGUtSRegGcsWbnLD0/tmvJCOIglyzK2og7HU6Vw7P1f166Wu8BEFiE8qvm8uG+gKO8T9b6igeWI6EUe/CDfwRfREVtBeil50Wh8XoUn6EbmXKk9yMd7OUss7dk6lmbS5XcAWl+gWr2BxolIW6258dAL+Ku+LFeZZtxcPbo+WT7H62Zcl/nAyIDbnvstO2hRZdg7o8bJsY+IzrtVaNQz25iDjMHrNl2ildmKKBE+hOM10TuO4No1euESU/B3tzSOIlF0CGTYjl2tcJlzSNM/hMJz3cMANOf3x5G9W6F ZH46EJQI vGJ12mPrfBWQd0Yv7TW8Q5X+8xBFAGSTXhibXk6Nfyx+Nqh0ArgG36c0P4eHiZdrjOtEJnU2XvpHeli02ZZpBUKVCg66C7MRnvn9sHfKi68IIUhaHVmlha2oVdoEuH5Quv40u4MiGGWFAtY3dl/k0sTR3uHhFKBqfXnJSHWLJlH83nCyQn57wuY1IyfrippTQGR4TE6T/LBMw+LQirYAy6njFZNbhsfMRlEjD X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2023/11/22 21:19, Vlastimil Babka wrote: > On 11/22/23 12:54, Chengming Zhou wrote: >> On 2023/11/22 19:40, Vlastimil Babka wrote: >>> On 11/22/23 12:35, Chengming Zhou wrote: >>>> On 2023/11/22 17:37, Vlastimil Babka wrote: >>>>> On 11/20/23 19:49, Mark Brown wrote: >>>>>> On Thu, Nov 02, 2023 at 03:23:27AM +0000, chengming.zhou@linux.dev wrote: >>>>>>> From: Chengming Zhou >>>>>>> >>>>>>> Now we will freeze slabs when moving them out of node partial list to >>>>>>> cpu partial list, this method needs two cmpxchg_double operations: >>>>>>> >>>>>>> 1. freeze slab (acquire_slab()) under the node list_lock >>>>>>> 2. get_freelist() when pick used in ___slab_alloc() >>>>>> >>>>>> Recently -next has been failing to boot on a Raspberry Pi 3 with an arm >>>>>> multi_v7_defconfig and a NFS rootfs, a bisect appears to point to this >>>>>> patch (in -next as c8d312e039030edab25836a326bcaeb2a3d4db14) as having >>>>>> introduced the issue. I've included the full bisect log below. >>>>>> >>>>>> When we see problems we see RCU stalls while logging in, for example: >>>>> >>>>> Can you try this, please? >>>>> >>>> >>>> Great! I manually disabled __CMPXCHG_DOUBLE to reproduce the problem, >>>> and this patch can solve the machine hang problem. >>>> >>>> BTW, I also did the performance testcase on the machine with 128 CPUs. >>>> >>>> stress-ng --rawpkt 128 --rawpkt-ops 100000000 >>>> >>>> base patched >>>> 2.22s 2.35s >>>> 2.21s 3.14s >>>> 2.19s 4.75s >>>> >>>> Found this atomic version performance numbers are not stable. >>> >>> That's weirdly too bad. Is that measured also with __CMPXCHG_DOUBLE >>> disabled, or just the patch? The PG_workingset flag change should be >> >> The performance test is just the patch. >> >>> uncontended as we are doing it under list_lock, and with __CMPXCHG_DOUBLE >>> there should be no interfering PG_locked interference. >>> >> >> Yes, I don't know. Maybe it's related with my kernel config, making the >> atomic operation much expensive? Will look again.. > > I doubt it can explain going from 2.19s to 4.75s, must have been some > interference on the machine? > Yes, it looks so. There are some background services on the 128 CPUs machine. Although "stress-ng --rawpkt 128 --rawpkt-ops 100000000" has so much regression, I tried other less contented testcases: 1. stress-ng --rawpkt 64 --rawpkt-ops 100000000 2. perf bench sched messaging -g 5 -t -l 100000 The performance numbers of this atomic version are pretty much the same. So this atomic version should be good in most cases IMHO. >> And I also tested the atomic-optional version like below, found the >> performance numbers are much stable. > > This gets rather ugly and fragile so I'd maybe rather go back to the > __unused field approach :/ > Agree. If we don't want this atomic version, the __unused field approach seems better. Thanks!