Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp608346yba; Wed, 15 May 2019 07:02:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKGB6gq5g+B1AbbNecKgu/PQ96VQ/y/8UvHM8Ve3gDjJqgW+DDqdS7A5aMjVZ6kFgpeaYb X-Received: by 2002:a63:730f:: with SMTP id o15mr43989375pgc.315.1557928934630; Wed, 15 May 2019 07:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557928934; cv=none; d=google.com; s=arc-20160816; b=MMws2MgmUFjELdB9yjMEQmYYNr6DxSD2ko9UfprveUbmB/rFX397jq0oz14vHrr7aY LZfD6KdVPa7D2YV+ubp/6ft+z78E+qnb25Ex/c2OO+1xzVGb7iaG0GisK+REi3A7GsLH pCkIAjx/0WceQWhYInxjvQZ0oGho8ctbs87wbjpOzZmRgo1KHY55iVGkoNOOrr2M2J+1 BxJLPSnuEQxLgQRiqBC9kO1h3lodVhFeRa7PFBcq4gIoSv75Q18tLuTTay15ndjgbxrz wiFwt11n+25C1QZQ1jb9qsZF3OtQKN0zWUJA7dbuXYtVGCidDGyxP0ftRtNh1HvTOd7A Fxvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=4ieRb2nYTufrIwfIxuW2F44/d/JKF6r4h/5BZmbEcuI=; b=ALKM+9XNMjcTjSVh/KXmyFIg2UCzaiZ9skH4nzV2ySxlJlQJS+6iEUCAO6uIGyG6O1 cEpeenpGehe8OjaHZDfz4H559xkzbA10NHYyVwIpZHLcYtRNSjlpPO4giy3vUm8oNoc6 BXno9j+DmkkcgohEVIhOsqexfpty38yYTZpR6hdi6oLFRr5bOkA7CECj5dABdpeaOS8x ycd6bbMCnGarUkl54DLhhpDApa/BaaTmqKemMF5VIopFwU15V6PJwOXB9ZjLO9FNIWhi TkSyImauxnB5o5AwS0DecG17E6M9oWH+0R0qi0/t6Rcfrk8VvDQBkRPJLXnZti4ep6LC POUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=GPh6v1G7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si2185967pfm.18.2019.05.15.07.01.53; Wed, 15 May 2019 07:02:14 -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=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=GPh6v1G7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbfEOOAK (ORCPT + 99 others); Wed, 15 May 2019 10:00:10 -0400 Received: from a9-54.smtp-out.amazonses.com ([54.240.9.54]:43512 "EHLO a9-54.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbfEOOAK (ORCPT ); Wed, 15 May 2019 10:00:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1557928809; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=4ieRb2nYTufrIwfIxuW2F44/d/JKF6r4h/5BZmbEcuI=; b=GPh6v1G7tBjvpfFjo9hMZCwciiN03v/sot2b6JO2p5YHO8lXYBnhnIAa773fVXRu NGiplz1lNIFeTYhBR7fj8DXMn08uMJgxeOHgROgOZJOZJdlyx8cjerUOr72NjVKKNYE reEPlVqpmXBv9O4oVqSDSIIrIfo8rpP9+X97ikkw= Date: Wed, 15 May 2019 14:00:09 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Roman Gushchin cc: Andrew Morton , Shakeel Butt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Johannes Weiner , Michal Hocko , Rik van Riel , Vladimir Davydov , cgroups@vger.kernel.org Subject: Re: [PATCH v4 5/7] mm: rework non-root kmem_cache lifecycle management In-Reply-To: <20190514213940.2405198-6-guro@fb.com> Message-ID: <0100016abbcb13b1-a1f70846-1d8c-4212-8e74-2b9be8c32ce7-000000@email.amazonses.com> References: <20190514213940.2405198-1-guro@fb.com> <20190514213940.2405198-6-guro@fb.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.05.15-54.240.9.54 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 May 2019, Roman Gushchin wrote: > To make this possible we need to introduce a new percpu refcounter > for non-root kmem_caches. The counter is initialized to the percpu > mode, and is switched to atomic mode after deactivation, so we never > shutdown an active cache. The counter is bumped for every charged page > and also for every running allocation. So the kmem_cache can't > be released unless all allocations complete. Increase refcounts during each allocation? Looks to be quite heavy processing.