From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (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 587C53161A1 for ; Mon, 24 Aug 2026 03:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787543580; cv=none; b=L/K0WfKu9MW29l+qp3Ja/afOt6zjQpB23dw7wtQlGgSfQgCC1E+gJ0EyL6BmbUFBZqwIjv6HMXHmdtet7ACPA6YE7oBvDg1JtPq8Kb1Z8CvkXYjlDu1syxPeJxd7fKW9D3WA56Hx9RvVXOL5OxS2QZ/5wzSK4hjfcTAfTbblLsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787543580; c=relaxed/simple; bh=xvaI6+hkPF5cHXFpF6ukM7uyine27oFBWDmOdEm5K2Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WUn6piYdBe4BoanagfRM4l8Eg+7KdkMu5I5WFXRQITMsiUUP1KIlr4yJtqjw+3wFLVZM2JcCZJr6L1mHfWejheUK4oPV5SZ/X5fKS7WhUFrO/qtj0rmG/fyUATfMjXPb+5RUr0ftjpHfZ01YRIGM0YSdKy+PypggVM2we2mWP+8= 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=J8gfm+vJ; arc=none smtp.client-ip=209.85.219.42 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="J8gfm+vJ" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-9063b380982so35023526d6.0 for ; Sun, 23 Aug 2026 20:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1787543578; x=1788148378; 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=+NkwZvgRmwHRjzupt0N+f3fvk1vj4jZO7Q0jmTyKYe8=; b=J8gfm+vJKT+dZuN+5PsuqYvrhEJ+EiNGI5OKnQZV9hjUZlub1FgYZq8JPoWnT9KN7C hv7ad5qKV9G/ik0oMaQQycLawlByV2HMa/LVjWXXjUGnmiXL/IZbeLGYqpmd7zoNMvsq +sJ1wn87Dcib/6zPNvRbcVJ/moyEO2FPu0LpoHPRM1/s91tRqB1olFnc203DKZMYDTxW q/F5+Vf4Kuyl3hhINOnPWG/Q+Z2w7iAZj7KasF0WmZjfWLfPgh9+mdY8F9OKXXVdf7u6 J5mWp+NXWg1d9mXt9ZnMeHcL37YOdhZYcfyQwK1I+RW4Kkl7HZHUiAqJZBhnuyV4jJIE n+mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787543578; x=1788148378; 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=+NkwZvgRmwHRjzupt0N+f3fvk1vj4jZO7Q0jmTyKYe8=; b=HnQZ79y4px9VL7S32/2MX5rauxq96PU/RLyCM57idGDtI9sZuKQlm3/R4GvcqTDA4D AoF50nVM1DohN+rhmiFvE3xNrWuUnNj7St++njFP04uGlKbC+Dqqx5m0SKlQYt1Rg4oC U0w2/HdzqKdUfXSdrlYy5lTfU/gmfzamjy27NRRBhYE6c7Rm7vmFeiEMKWt8bAZ8nZXS ODPuHIeaC1nW7XYyKMgXQK61qasIb+u7TXtCkjQyXN+Bf507mQRzmf2J35c9n6dQi6zi tV026I6F2qTdQH1w8ewuZeFuqVMR/M2FWCW/XW+dxjFkco4HaL6kzGRD1WuzTn4y69L5 yU7w== X-Forwarded-Encrypted: i=1; AHgh+RowomY/moIW0kg7nSSuSzgjANvNNA3Cc9PtjV2RIVyHZ03xzfVq8vnsQk3MrQ/Oa6llss1MQavWKcYpgbA=@vger.kernel.org X-Gm-Message-State: AFuF++npZz3/eKFL2JBJZb0FCbo/xN+iac8/rrystlIx0334tqHEb5zC fR69IsZudozvqfIol+o+zOU/1cZrc7LXHXwnzc3E/RVsJZoJyydH4Xvo59+hdfdbDRU= X-Gm-Gg: AR+sD13P/TCHp4ot9Uoc3RH0ekEHKsgq73n+rSMaaVo/7xQpNKTXZJUk1pK3HqDNcIG mEvy3H2IyKdl33SAAhGgy/wYY7x/adqlY0HLJviLVyEdAIrlq+wOyytvJEdpLg8KGvnf6bRVMwi JSfVMpNBSVn6cuTL8TLXQc4CArFBaCdmi76IFc9O0h9dXdmORAnYAidnkdyjgr68xseqh9WNehc Wz9DP5S010RDB5dT6mBIyTJOlHSJ/huU77fFPZ9zm8z1Cn/kb0+4BevoFCk5OWxBsCoeB7q4xpI kyEnoxw9PKOnU01Bru5ajdpeEvJfjJWCqC4tbvEKcsSVdFZLVaR0wqt2RqG2ZSuno9dKH6bj8IZ VCi/vLe78iK39hBN07X1L+4mZuS0wK4YsQ/IOg7OLx1XSskMvaoksSxsaKpMfa08ehYm+lt+PUk i6P8Zcndqb4kggnKhaQyTbfcYBVLWVqRFObbIdoMxiQivMZOkk3E+AWTQW2cWJJMNrFQpZ1r0ju 0ct+cXyeNMPUxldgtZNqP5PJd0BGVFkYcEONP5GmV9k X-Received: by 2002:a05:6214:860a:b0:907:d89f:f9ce with SMTP id 6a1803df08f44-90c8f95710cmr155411406d6.12.1787543578189; Sun, 23 Aug 2026 20:52:58 -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-90c9393203asm51021056d6.23.2026.08.23.20.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2026 20:52:57 -0700 (PDT) Date: Sun, 23 Aug 2026 23:52:55 -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 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. ~Gregory