Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1380335lqt; Wed, 20 Mar 2024 02:03:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVRbmEub0cAjKDI4P204xUtCdNdcX4RXBjGGnJtRBdcY6jlk8qOXBCnWd6KGJXCjAm7fly3+zmPIndkPJtEr2bgvTlUPmRbSCuyl4JHA== X-Google-Smtp-Source: AGHT+IHdwBF9ittP7B6OJoHHrhr3vk5UCbSvAb27FI6yIKA8EbbECYkjzN+pGoXJB9b55MJAd5ez X-Received: by 2002:a17:90a:5288:b0:29b:bd2c:7238 with SMTP id w8-20020a17090a528800b0029bbd2c7238mr4902237pjh.7.1710925394658; Wed, 20 Mar 2024 02:03:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710925394; cv=pass; d=google.com; s=arc-20160816; b=tf16sz6y0ziWvHz5Ho4+1aEqbNlWHYryONIIEvpiR++WnLmL92YBwVh34HAeeCQif7 QpxPDNBQp41PFWXl4gQ+oIyrkNSDT/Lg5U1r+FbYmVqEh0aRjk9OL6gmjxi/9gGu3x6s AGW6ExVt0f5HCLdV9/zsjzr+IjTFPUKXK2InlUG2S5aE79n6GMGQVeDGlxflVCdCT4rw oIN7weM1MR7hbftGYg1iNULycNKHmWKEWxhtYz1TjdjOsQlBDYSo5hgT78TWcox3vNwO Ke3ZV5udlBR5Pbm+qIzrR/qPE+4aDT6UBbPpuHXLiRExxtGlxzj8Mw6PwWEKrWtiMNon PiVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=e853/CIeP1boPVzJEG82oNvtub+iVamjhYN4igRh6aQ=; fh=ZYap62bmgtcivi4nxFTXytPnHMXsleb7ZVNO53ZIOIQ=; b=ZqmuHALHiTZe66Mx7SCly++oXY0hqeMUsDGnO57jSSr4XvsU90qfIUC/2UCK4In0Ow grtCf111ODiq0851sO2Fy/crrqsaso/h4eftcvkcZ8W12LQGFJ/EAvGu9lCIWrtd0Ckw 07sqSNy7fUd9hqVtigRDDWIWtQ8z9bxo2lvuNtqt0lqkur2mF2IPPwGBNQCfXXfyYNIH V9URZxbN1eizF7DRw7qT250TZwPOR4At58niNOWnDl6euI1IjhL1u93VY27pT3PDCwLB 12yc4ksl+7Qr0yVCuQkJbmDZhhlNbFyFYWSPaeIe76fHuXqsaZ1LLGJxFDETavYzVcX+ lYXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=IaS7zYhi; arc=pass (i=1 spf=pass spfdomain=rasmusvillemoes.dk dkim=pass dkdomain=rasmusvillemoes.dk); spf=pass (google.com: domain of linux-kernel+bounces-108668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108668-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s4-20020a17090aad8400b0029b9dabf510si1026568pjq.116.2024.03.20.02.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 02:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=IaS7zYhi; arc=pass (i=1 spf=pass spfdomain=rasmusvillemoes.dk dkim=pass dkdomain=rasmusvillemoes.dk); spf=pass (google.com: domain of linux-kernel+bounces-108668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108668-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5A970283902 for ; Wed, 20 Mar 2024 09:03:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA7B438F82; Wed, 20 Mar 2024 09:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="IaS7zYhi" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EE0411720 for ; Wed, 20 Mar 2024 09:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710925388; cv=none; b=K6VHLcDMbld5CurHfTelBf2L14a1M+4S8pOXgm3zZ9FqRcE2wrrZxZOK/e1jMbAlCz2OV96VPWPOFTB77jKPQPuLspkSK+IS+LNzN5VtSl+V2jyRF8Ky1PzUq/KPvz/AG6aL9+dJowCKELsDN+wG62pAtFJLFIdCEVNP6BoTfoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710925388; c=relaxed/simple; bh=BZa6c0MGicxhcKWAIIPG4HIyh39wkSHV3YBPceFQLP0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NngcNgMW/RiwEq2oJCmliqwUqPzZUp3mcT/DI0BoZmQHHowhxHhxZ5Lj1VSTA8CDtLCQDsHF8pbXUGlfHCjCnk4Q/52scS3GxaELG1S3FGewB4ANf2shvyCxsPMTuEyRx/KeLv1qtvTtpluc46fHopP5hM/fN3Czl9ZGF+9W+6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk; spf=pass smtp.mailfrom=rasmusvillemoes.dk; dkim=pass (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b=IaS7zYhi; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rasmusvillemoes.dk Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a46ce2bd562so358478366b.2 for ; Wed, 20 Mar 2024 02:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1710925384; x=1711530184; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=e853/CIeP1boPVzJEG82oNvtub+iVamjhYN4igRh6aQ=; b=IaS7zYhiwdHxCCAlvqU905poz5kD2P4V9ol+h5yoNk8HHKjuJPSTmDYKh3P1x4qFkk VP8MQO2jJlk6wa2jPq7KjTN1hFgmT5VOKoeZhHmTxmdd+wtG0hlZEnUbnOrJvmQ5WZV/ HaXsQTbgh9sdBDXlThO6PCVc+Z2wJ96qKyZls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710925384; x=1711530184; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e853/CIeP1boPVzJEG82oNvtub+iVamjhYN4igRh6aQ=; b=hU5Rh9qIq0SmgvrS/w6bg5TGQGshbZMfJvczKOMtHRJge8LH/SqlQqQw+c/unQQVtx UKW6v1vUpMrUIMak12oStwcfhps3uLsmQ2CiBrb/IRu3iv5S9Cq59fqKACQ37WflXro6 solPlHWt77UFIeDmaJ0IUQ5PWaBCb78zQOpVMXRb9HDwwJEpmgRDuw1M8qrM6/qe70rA MugjgWTc+ww1tPSOQsL40H9MIdL6NGwmYADFf3IxBF/A3EWNKgPSxbkUGH2vJYvw8A4+ e/8Z0gVuOGVKVKNcvKXceMfJY0zfC4Ws7pXSFzGXOE+1nyCkCPOu02PF6cqr2IpXRuiI Gqcw== X-Gm-Message-State: AOJu0YwTdUKYnnVTy+TM8m/aBj0XGOG8mJjXk6VENMNYvKHMs0krmsob TD4HS3CNjL9qP/3PUBnRbDEvImi5/SiK0J1VpFAvyIc8hh+7J5TUaoL20cJhOjU= X-Received: by 2002:a17:906:264e:b0:a46:c11d:dd05 with SMTP id i14-20020a170906264e00b00a46c11ddd05mr3741140ejc.57.1710925384086; Wed, 20 Mar 2024 02:03:04 -0700 (PDT) Received: from [172.16.11.116] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id g17-20020a17090670d100b00a46a04d7dc4sm5108801ejk.61.2024.03.20.02.03.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Mar 2024 02:03:03 -0700 (PDT) Message-ID: <5a6f58c5-40f3-4c89-8988-a9fee932e3ca@rasmusvillemoes.dk> Date: Wed, 20 Mar 2024 10:03:02 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] cpumask: Create dedicated kmem cache for cpumask var Content-Language: en-US, da To: Dawei Li , yury.norov@gmail.com, andriy.shevchenko@linux.intel.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org References: <20240319122400.399516-1-dawei.li@shingroup.cn> From: Rasmus Villemoes In-Reply-To: <20240319122400.399516-1-dawei.li@shingroup.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 19/03/2024 13.24, Dawei Li wrote: > alloc_cpumask_var_node() and friends allocate cpumask var dynamically > for CONFIG_CPUMASK_OFFSTACK=y kernel. The allocated size of cpumask var > is cpumask_size(), which is runtime constant after nr_cpu_ids is > freezed. > > Create a dedicated kmem cache for dynamic allocation of cpumask var. Why? > The window for creation of cache is somewhat narrow: > - After last update of nr_cpu_ids(via set_nr_cpu_ids()) > - After kmem cache is available. > - Before any alloc_cpumask_var_node() invocations(sched_init() e.g). OK, so this sounds somewhat fragile. It's maybe correct, but I fail to see what is gained by this, and the commit message does not provide any hints. Rasmus