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 53F52C433F5 for ; Tue, 7 Dec 2021 21:45:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8A706B0071; Tue, 7 Dec 2021 16:45:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B3A046B0072; Tue, 7 Dec 2021 16:45:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DAA06B0073; Tue, 7 Dec 2021 16:45:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 8E5F66B0071 for ; Tue, 7 Dec 2021 16:45:17 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 59C828771E for ; Tue, 7 Dec 2021 21:45:07 +0000 (UTC) X-FDA: 78892329054.08.4880B46 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id CCFF4B0000A0 for ; Tue, 7 Dec 2021 21:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638913506; 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=wAI5JnG1T3Xc8dsK0F9qlNVnynQkpY3/ReLlmQqCN6k=; b=LfXCs4iaqQ5rdjsCojiKBYCoyl3pNay7HVwAOpzTklJUpL9ewXVpXY4DghKzFdJqidvizC trLCkgUX1TLWxUfL4bYPa9ljpTrDGsi/5uPFzt5EjO+rfVELS8w04sqmMJe0sX98wbj1ey 1BLZlXWx/s1fM0u3EXVeEN+NPAfNGRw= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-LiLZdSuQM7yMxRnwFQ4K7Q-1; Tue, 07 Dec 2021 16:45:05 -0500 X-MC-Unique: LiLZdSuQM7yMxRnwFQ4K7Q-1 Received: by mail-io1-f72.google.com with SMTP id w16-20020a5d8a10000000b005e241c13c7bso703541iod.3 for ; Tue, 07 Dec 2021 13:45:05 -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=wAI5JnG1T3Xc8dsK0F9qlNVnynQkpY3/ReLlmQqCN6k=; b=HboiKAPo9wrMQUxRykHwdGPU7wxm9XsMAaECoY967ed20gxNUgmADkqW1dta+rheK4 KkNslAVgqAJXSe2On7qPDKm/ICgfkVxdQjs77+C6zBksNjAQQembaLkO0K/2zCXZNtj+ eflHZQvV0D2i4ChHNi6tAhiNfOTC2D7aHoIgbaJTcGH1BAEXIfHGr8C0ZCDnZyHnSgaT hW1kQp1RyJNECJsuFpwC5i2ME/EMziHQUfQwlRR5bGG8ImncAwYuwgP7dMotDECYZCpu f7u64lbi17kBuAJl0d0If2WNP8RrK/kfzfNS4RpoVH5/721DgAHI/cmf0uszxyuKdB6x 6T2w== X-Gm-Message-State: AOAM533wVxUK6jvHW6ZdpX4AFCm2amvS448e7bNHnXs37Wyr3Frn+i2k mIzQwVpw4E+04PsEawvbGJ5JJbN4TtNsJXea5RtqzyOSDrEjFUEIbHJIihVzuhA2yR98kWhmElh rbGWufAujHiE= X-Received: by 2002:a92:cd8a:: with SMTP id r10mr2266900ilb.188.1638913504615; Tue, 07 Dec 2021 13:45:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMYHZCsw1EHLrPo28/eQFU7UdFKfesrmnc9NhTiTFBVkdcv5Jmy5Sdnopv1qfJC/LlSL2ahw== X-Received: by 2002:a92:cd8a:: with SMTP id r10mr2266880ilb.188.1638913504462; Tue, 07 Dec 2021 13:45:04 -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 p7sm532774ils.4.2021.12.07.13.45.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Dec 2021 13:45:04 -0800 (PST) Message-ID: Date: Tue, 7 Dec 2021 16:45:02 -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: Kirill Tkhai , David Hildenbrand , Michal Hocko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, shakeelb@google.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> <24b4455c-aff9-ca9f-e29f-350833e7a0d1@virtuozzo.com> From: Nico Pache In-Reply-To: <24b4455c-aff9-ca9f-e29f-350833e7a0d1@virtuozzo.com> 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 X-Rspamd-Queue-Id: CCFF4B0000A0 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LfXCs4ia; spf=none (imf24.hostedemail.com: domain of npache@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Stat-Signature: hf3u835co6fw6rxqe7bfn9cx79ohnr6c X-HE-Tag: 1638913506-338766 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 08:19, Kirill Tkhai wrote: > On 06.12.2021 13: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 ... > > Hm, can't we add shrinker maps allocation to __try_online_node() in addition > to this patch? > Thanks for the feedback :) I am currently working a solution similar to this.