From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (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 6A34B1A9F8C for ; Mon, 23 Feb 2026 15:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862334; cv=none; b=uROSJ5lag31dSC6vC1cuEGldk+o1BpjK65JXrQYi+27ipekFEq3jTs9sUKAFoam6b19UYxejQBKM+huO5t1Rzkn5UaGfZGQjKedxl1OZ1yQRKLj5i7OnILLmAACnHO29aHS/jt/Xo26H3mnZAKtZ4DUuXHIknjZlCp6cCfO1SgI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862334; c=relaxed/simple; bh=+6jS37I+1wbJ1iqlKg2dmc5dYnQE3LyFGZ64dOrbW/w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lBZnUkZILVA7nmsHpHAnBaXgjw7Lo4UwhNgpVIUcmzv5m8M4svUObZ4w2RruBDjT3uW0xBJOE3dwzguO7my644efyzDhehwrwwyMgVbgU3B3YCVqLIV/cTFJJpIqKHHFwHTzxaFxvqqj1uq7VZsLQkcOd8kq8mIqZLPRrYUCXmg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=cpy5aLQg; arc=none smtp.client-ip=209.85.160.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="cpy5aLQg" Received: by mail-qt1-f196.google.com with SMTP id d75a77b69052e-50697d6a69cso23723201cf.2 for ; Mon, 23 Feb 2026 07:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1771862328; x=1772467128; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gJlVVB4cdcMuEQ3h5OcyXP3aNJfq5CueqYlheuqsqJs=; b=cpy5aLQg4pfEGyz5TaDuHhTN64LtG66GHLYcvhqrcV4xUC1pLJ70uSjOo5vTkuOHn1 nnNv/f3j/TKT1xJ7hBp06n9YTbKWBAT3w0Q0y8rhBwr6Nth9dxRNg81SkGwccoWq+HPw Wqdc6fTGHjuVqPUZD47vpaMjaEr9Qtro7pxfucvjNaiVq8VTlqPOWxNWGYbDWmH7Imsr HzHeT61m9lnKYOC/HP1ean/ePZ6AsT8s5jmVGnsqWP8mi8ynWqGJ4SAlL6GxmQeyb0iA Dq8dDmYdkYSEcGjsoWw0DAiAVjALzAHgaTpls70b8m8ImVJf31GoVORK+gp6P6X7RoWi FFcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771862328; x=1772467128; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gJlVVB4cdcMuEQ3h5OcyXP3aNJfq5CueqYlheuqsqJs=; b=R7em72BH6gNaSgrEKIJeOx+vXVyZpCHZEEfPh1uk475qHWLDid7V3OGGehtP/bpC9T uhycJ2DMFxCQKxElnv3lAmabKJfbkNwV2Lify6jr2+RspwMFojdhGg3+ca35FZ8MtXUA DzOFDVg9m74+ucIgzrEqcK6YPdzVItsh88bmKz6oLOymtpvQginDaK+kKvt5ViOf2eHv 4z7oyvnMpY0T2Ygvgr7qJVKKTJMnoC/6WX03GfE/QfJwgclHpFbMs3BFMhie6M524WvL 4IyNE9IZmvOsbs7JccTYCtp2SCNmM64uK5GCBGrUcDTwiDHTMe2cFlYKi/vQaT3xMFJR 1DEw== X-Forwarded-Encrypted: i=1; AJvYcCW1m8BPbkAaewKFmmqEAOPAtXHv+A/cG16jcqSK3onXWjmn4B/rdtW83NCzf7SxsNsVF7/evu1a2nwRZ/k=@vger.kernel.org X-Gm-Message-State: AOJu0Yxnz0u+wG4IKVZzqvEYhFX7MByX+Xupo7qHTAZXjTlkxHvei+Sk uNxS7hKOpkINax5FKKcmYUgF7ofF135CMKNbkOepHCNb8Ahyu3Ajigvgh0sChuX8L3k= X-Gm-Gg: AZuq6aK0CQSzP/XhGtg/eWsehmmEoQ2rPQ1JruLqgNhYilV+hET0PctBhCBA6n5t4ms ee5YLDQXvQZyqRHRyGJg9zFAl4sY5sFwCJKvpfP/b4ZMloVN14efFxBNWWHvBZOrT7qzQrMMBRW JiH8YkUFiCJjIquMsUxT0ln0QY8B7Gbpfi1sEwUkyDOF9OxEaUdFQoNo6pCmAqUVk4YmwdORo35 T2+a0jy0+BC0jAuFQQRPqUKILQ1iIphiW4vOYodce5QfkbQMD4RSnmnnm/PtpZBARgZuSmi2pLG uLINeM+dlr5IHwoA+9KH7zJcQCtOOitAcmF6jfp9vkcq3MwlXwdZTgVdXru/zL4MkM/+dTE93bO U8JdZI2fxCa+38JQE9yfeax47k1jQH+KWN5eCLKSE3qB5wP8PNKqAfZLHissHb5YbQrremeRLxV x2Ke5RNvD/igLY2PxNafgYIw== X-Received: by 2002:a05:622a:181b:b0:503:2d06:8e1f with SMTP id d75a77b69052e-5070bbcd9b4mr109231921cf.19.1771862328143; Mon, 23 Feb 2026 07:58:48 -0800 (PST) Received: from localhost ([2603:7000:c00:3a00:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8997e24627csm71706556d6.29.2026.02.23.07.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 07:58:47 -0800 (PST) Date: Mon, 23 Feb 2026 10:58:43 -0500 From: Johannes Weiner To: Shakeel Butt Cc: Andrew Morton , Uladzislau Rezki , Joshua Hahn , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm: vmalloc: streamline vmalloc memory accounting Message-ID: References: <20260220191035.3703800-1-hannes@cmpxchg.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Feb 20, 2026 at 02:09:28PM -0800, Shakeel Butt wrote: > On Fri, Feb 20, 2026 at 02:10:34PM -0500, Johannes Weiner wrote: > [...] > > static struct vmap_area *__find_vmap_area(unsigned long addr, struct rb_root *root) > > { > > struct rb_node *n = root->rb_node; > > @@ -3463,11 +3457,11 @@ void vfree(const void *addr) > > * High-order allocs for huge vmallocs are split, so > > * can be freed as an array of order-0 allocations > > */ > > + if (!(vm->flags & VM_MAP_PUT_PAGES)) > > + dec_node_page_state(page, NR_VMALLOC); > > __free_page(page); > > cond_resched(); > > } > > - if (!(vm->flags & VM_MAP_PUT_PAGES)) > > - atomic_long_sub(vm->nr_pages, &nr_vmalloc_pages); > > kvfree(vm->pages); > > kfree(vm); > > } > > @@ -3655,6 +3649,8 @@ vm_area_alloc_pages(gfp_t gfp, int nid, > > continue; > > } > > > > + mod_node_page_state(page, NR_VMALLOC, 1 << large_order); > > mod_node_page_state() takes 'struct pglist_data *pgdat', you need to use > page_pgdat(page) as first param. Good catch, my apologies. Serves me right for not compiling incrementally. > With above fixes, you can add: > > Acked-by: Shakeel Butt Thanks! I'll send out v2.