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 BC63DC433F5 for ; Tue, 7 Dec 2021 21:41:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B14A6B0071; Tue, 7 Dec 2021 16:41:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43A3C6B0072; Tue, 7 Dec 2021 16:41:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B3AF6B0073; Tue, 7 Dec 2021 16:41:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay028.a.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 1AF056B0071 for ; Tue, 7 Dec 2021 16:41:15 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D1AC2209F1 for ; Tue, 7 Dec 2021 21:41:04 +0000 (UTC) X-FDA: 78892318848.01.7D0EF19 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 564421000098 for ; Tue, 7 Dec 2021 21:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638913263; 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=nGmI7kQNWbEvmiA/4SAjJ2qlBrwJRawfyO5CFs01+o8=; b=AMjXZtoF17P2hRrrauEt7k9pLgTyXQVDtRTOBltMx9uP6+zbKHWYx2FKucLvXc3WyRuBLA e18FF6Bvm59l+jPscVfAHN4Um06TDheRue3RVydtALtn6KtYJkJpKO/zfijg71aGIwgwwi 0p490dNIszoRIZie2wpNbZdjV0ThwkE= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-470-HzxcgaW7OYGixmMQwn8icg-1; Tue, 07 Dec 2021 16:41:02 -0500 X-MC-Unique: HzxcgaW7OYGixmMQwn8icg-1 Received: by mail-il1-f197.google.com with SMTP id r1-20020a92cd81000000b002a3ae5f6ad9so559957ilb.8 for ; Tue, 07 Dec 2021 13:41:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=nGmI7kQNWbEvmiA/4SAjJ2qlBrwJRawfyO5CFs01+o8=; b=ZUckV4XYsEZaIggJ8o6JBb71D5f+n8njLr2/FrkvnPQ1TAPPhpuWcAmMqZiQCGScHp UR87V1Jkm1tOsccwwdrpMq5kYXSyGWZgRYB5ddlk0u8f0aoYA2c4I19TJv0iSoa45Z0V jOgK/NQhVCnkLcmKzkE2cZMeDu39FRRa/v5apFFs8kMRtlNq5zB3RrvodSrBJTbiaTmr acskL1VcQVmTnTZIfjlL2+uOdxIFrM24J/UzQ5IcVEMEXgh5jxIqOhR0FIKQRucKFyH1 xzOP4ku7tKqydj4KVmjNTPJKfgIxyR0UiUph4Ov73iUq0zwbgnmK2JeBAg79AXca9OQ5 e8gw== X-Gm-Message-State: AOAM531MKLNkKxA0La8riJDDVJYsWcw7qFdrmF215i6/lqq1AlPqMEMr Hr1Ihe9bQTTZZbv+8Gf3THBh5v/QJl7+p0tgukHRaqm1qT/Bac0jiKG/iqSDTQYZevUuji9EyE9 SIog3yh0G8U4= X-Received: by 2002:a92:cf45:: with SMTP id c5mr2425561ilr.251.1638913261643; Tue, 07 Dec 2021 13:41:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyqM/PzhfSjpY1htyvNIqqhuJr09WYEY8Im1t+31spDfvEcGYCirMt4dgyvgcJNfQWEWYJYQ== X-Received: by 2002:a92:cf45:: with SMTP id c5mr2425496ilr.251.1638913261131; Tue, 07 Dec 2021 13:41:01 -0800 (PST) Received: from ?IPV6:2601:280:4400:a2e0:7336:512c:930d:4f0e? ([2601:280:4400:a2e0:7336:512c:930d:4f0e]) by smtp.gmail.com with ESMTPSA id y8sm594581ilp.46.2021.12.07.13.41.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Dec 2021 13:41:00 -0800 (PST) Message-ID: <8951b82b-d95b-5e22-9846-c78a330f57b7@redhat.com> Date: Tue, 7 Dec 2021 16:40:57 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [RFC PATCH 2/2] mm/vmscan.c: Prevent allocating shrinker_info on offlined nodes To: David Hildenbrand , Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, shakeelb@google.com, ktkhai@virtuozzo.com, shy828301@gmail.com, guro@fb.com, vbabka@suse.cz, vdavydov.dev@gmail.com, raquini@redhat.com References: <20211206033338.743270-1-npache@redhat.com> <20211206033338.743270-3-npache@redhat.com> From: Nico Pache In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=AMjXZtoF; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf07.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=npache@redhat.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 564421000098 X-Stat-Signature: enpfwf81j63jp9pyti5cxd4ora7qmyk6 X-HE-Tag: 1638913264-47680 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: On 12/6/21 05:45, David Hildenbrand wrote: >> This doesn't seen complete. Slab shrinkers are used in the reclaim >> context. Previously offline nodes could be onlined later and this would >> lead to NULL ptr because there is no hook to allocate new shrinker >> infos. This would be also really impractical because this would have to >> update all existing memcgs... > > Instead of going through the trouble of updating... > > ... maybe just keep for_each_node() and check if the target node is > offline. If it's offline, just allocate from the first online node. > After all, we're not using __GFP_THISNODE, so there are no guarantees > either way ... Thanks for your reviews David :) Yes, I believe this would be a viable solution. At this point it looks like our short term solution would be something along this line. Long term we would want to either allocate all pgdats (which will waste memory) or update the memcgs with the appropriate node information once a node is onlined. Im currently working a solution that does the latter.