From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 3E234368D6F for ; Mon, 24 Aug 2026 15:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787584203; cv=none; b=uhW7g5z5QsJpMcV4fYKhVy9aXRpiX2mn56lDsTDPnA2L4aS+1hXnOeWaPeTZnMyrWODBRiTc1VkFj82AGkzYcpQu+s8t0cvk6JDrDX9494T7a7pUdKlVIyqfkDSWuNxlaZdEiMXeVJa3cKIsQkikYgsQ7emfq1EA+m68C0k4qeI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787584203; c=relaxed/simple; bh=dfMidm/UL0JV4R20isZPTs+J7q4aMwjodEzJbjwDOP8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Vpam1uLpJROa4/rZpq0MCaDKz4SIesJAZn3lR92I6x4LqlZodRn3zwOKcDwu9BPTLosbi/YvuVxkxnv58wFg99xR0l8+R6AdbHVygK82l8Tnlnf29iWQ+ANEchKEZaohPiuttbnzDhnt18tu9ypBSr0bAoyTjZlvNVhi63GeBmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=kE9fLcW8; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="kE9fLcW8" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-90c522298d2so22302616d6.2 for ; Mon, 24 Aug 2026 08:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1787584201; x=1788189001; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=k6j7WBdzhGUFGnvNUS2cIrQrd4SkMPF+Ufhv82BZDwo=; b=kE9fLcW8B58J6ulEDKedM0q+6/JLQLJvb6+8Eq2mrdZ8u5cAsAsYN7HaJCgaIdM2kH G0xZ5gE7HXWHfpRJ4UmGt5+HTV9ulZ5yqzWLWy1bRkv/VaOMhrvYzanzaowaN5h6T3Nz MQRhtfJW9A6meI3MNzNwZ4l9I6gYo2rerBM9A2t/RVpNB77g0SvgDfgJy3Zq6t5uGdHF 4egJYV5YRuRJcsfwuPtdVeajKGTbMVKoU1LyNZJwb6WigRhDFW5oEJx91ebe8sCvEHnr pVnv968Wz8vRssCIuDTP5w2pdS6CDSwwHuamglsXEIVAoq2hau/pCxW+R2k+HJyvCjjC gJmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787584201; x=1788189001; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=k6j7WBdzhGUFGnvNUS2cIrQrd4SkMPF+Ufhv82BZDwo=; b=QndXX12MFyf4zSxoquq5h/usnFNYQPogNqHYmLiSe0D847Wb+YPMxHvxe97qegN1iA HaA+Qk9S/jvRE7Eum3W1rYL7Zp14VGxsr/DyMaCtoUSBLuRClOUHudPnHjcoB3KVzwcn I2aOYx84dzZBzJLhDkxn3+YklzXM+ujnh5f+QHAdhNXU/gEy4n0nehxlQKd2+z/mRvA8 3adHcpHv+A7HWiaCp3ptaFJx56A+CRJ0hQ9j71BOHoJDoNzLXzMsDMRI7cOrbJ3+Xri1 bLg392PHBtjbJVuyo3xw/jGtfWSjP01Yunsf9mzVOVctMURsyf401xYz3g3hrVUQPqWq I3kQ== X-Forwarded-Encrypted: i=1; AHgh+Ro6PXQyKv+b2Hi5QCHbPyg2psgjNrkl9KZqTwyn2ot1agFlCivIQjDPZ8URy+xNA/UUk/HL4ykQZUzzarA=@vger.kernel.org X-Gm-Message-State: AFuF++mdByBTNqCsvQ242zvMnMwpKzVQmclAFKQPm4f63lwTHNJrwN8H 610wd0ilTTwSu3U7jgRPyP2JOoVKjTSPAItqYqGNrzo8curb5URzqhMHYaVFknjGdRc= X-Gm-Gg: AR+sD10cfroDqsPB/2szn+wuHTB4Dt9wtVjQPjl3ek4pkpuzVxoekLKzm7mpWyAeSH0 BYAFoR4HeIV4zRKlm+bruxBA90NLlEeAres5dU1XxINsZPXnaQjiKlBVHGX+vcOEDngWWt3m8VZ NM3ff64CFmDtFZWxqBGl/7xkApJ7Xn/vneGED8+//RsVwH5Pg1bfmG+IRwIamq/MHerv6uLqm9g qtF+ojYZB70vG9xK54hVx07YRzoCr8OTje3kYYSyovkG0WpR+LZ0oUJKFM6UI1Qig4LcD/dad9F 1yox+yh0lUjcshO3yx3Eyy6CDkyGbgn4VKQswJVJoRXZtHZ4p7XRjSX4v+MvgPO+6swMDWxdy5G hTaGhNlZlePw9j0geQmyDpuHqiESAwxiLEIRDo0JvqD6WDMDlAUm3Astz3iUEAggrVqO0TeqAty GQTBAM1sW8icZjS86v/23TB6X8CtLf7jNPmha5LWcEUVxUJIc3/Il6ON0mjtDcfzY8GslcyEuG8 Zq3zY3i6kVfHAZBkJn3Fcn/Ikpg9wLoGlyXO4MnWdaH X-Received: by 2002:a05:6214:21cb:b0:8f3:cf36:15ca with SMTP id 6a1803df08f44-90c8098e804mr271697776d6.9.1787584196428; Mon, 24 Aug 2026 08:09:56 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90c9360b07csm64972756d6.17.2026.08.24.08.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 08:09:55 -0700 (PDT) Date: Mon, 24 Aug 2026 11:09:54 -0400 From: Gregory Price To: Matthew Wilcox Cc: linux-mm@kvack.org, akpm@linux-foundation.org, edumazet@google.com, linux-kernel@vger.kernel.org, kernel-team@meta.com, stable@vger.kernel.org, david@kernel.org, ziy@nvidia.com, matthew.brost@intel.com, joshua.hahnjy@gmail.com, rakie.kim@sk.com, byungchul@sk.com, ying.huang@linux.alibaba.com, apopple@nvidia.com, syzbot+0dbf6d295b3350944f0b@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/mempolicy: refcount the weighted interleave state instead of copying it Message-ID: References: <20260821104043.f692421fec915c0c5bc1fbe6@linux-foundation.org> <20260824024117.1755899-1-gourry@gourry.net> 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 Sun, Aug 23, 2026 at 11:52:55PM -0400, Gregory Price wrote: > On Mon, Aug 24, 2026 at 04:06:03AM +0100, Matthew Wilcox wrote: > > On Sun, Aug 23, 2026 at 10:41:17PM -0400, Gregory Price wrote: > > > > Bit of a shame to take/put a refcount on every memory allocation. That > > seems like it might hurt (even being on a different cacheline). Would > > it make more sense to use SRCU for this? > > Bulk allocation - from some measurements it's about once per 100-pages > on average. Looking back at the data I was getting about 41 refs per > 4096 pages (16MB chunks). > > Have to imagine there's other cache fighting in that stack too. > > I'm less familiar with the rules around SRCU so i shied away from it, > but I will take a look. > I will update to the new fast srcu mechanism, but it'll prevent backporting beyond 6.18. Best to backport the gfp fix and update to srcu in normal cadence. Will submit separately. ~Gregory