From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 759B7227BA4 for ; Mon, 26 Jan 2026 17:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769449631; cv=none; b=PqTHEt114V4f3jmSRaOcRLGmrhptfrSO+c/FnUgSnQ7xT5nppMdYaEa0DvV4+cJXszVWDnqB+Op6GPOFwWHnTSdoBvZnyFJ1CwYot3tWXmZfl2Wo2RufaesP0k84YFrES9JMs6mIHB6v23pXikRVZChRXjmBX5dELd31sya9FSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769449631; c=relaxed/simple; bh=SxiigcO5jULVZQb+1TTV1IfnLgHH67BQCQAXlPCmZV4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mcJcik0ZgXBSNqolQ9W0rRFtS7pMkOe/h0eiMf75l/hr/xPdM+o80DMrxMNJ0jBFpprnaAaOTb51QO5o75BwwhukskDH3bEOg8LGlscf3HBBNCmboqmaDMNTqH/+yXREqeNekAj3OBpoKbYxZmNjB3Krw6rDYt6K+wdAT05TeEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=INOgFblc; arc=none smtp.client-ip=209.85.128.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="INOgFblc" Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-47ee2715254so24705135e9.3 for ; Mon, 26 Jan 2026 09:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1769449628; x=1770054428; 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=Mb/leG6Ch5DsFFPtx2vrqbxxpTr3aeU3kEJMHwQ4pjU=; b=INOgFblcWXjeH2dHKVybFbRSezcR7FNBmpFFUh3Rz9jBMPwl9weKbhvTQFfPzRBGCa 3oUVakKJ65ScTyOP/FhHSGTGyCz1AQfTFDXZlmak6kIvZ2tR+vYD04nKMzBPgisytc9M qS/aj8abAsWHw4rMKYhUJbaFbIb/kJFOK8VteyQDJr8hEccOMbcBKTx+E8LqeAnTY7Cz aqFnBh9OESJMDQoETVhBGaaFOksJaqIFBzoGI8+uB/VyFX8oE7ytyYhwmrNAEfUYnag1 D1+E8keeAWg5zFiOISn0JPC6o2BcoV9uH2V1T5OEKdnoVSkgNClSx7v2Z/kXvqyPBnS+ kggA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769449628; x=1770054428; 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=Mb/leG6Ch5DsFFPtx2vrqbxxpTr3aeU3kEJMHwQ4pjU=; b=sLhTw7EZQi2C9CBs/ZFLPJRRex3+D+7hTAPvZncwZ49UPz6i68E4selzWRg/Ennn5e FVlugAWBCrU8jtrIhaZLc7u2pe3WYdaY0T8BrTvstldEsIy9F3BfHGqYYSYI4awkZ2t4 YDfw681E/u4tkh0IadlQn/3LdXOuFYO14x82lVlbYqhW+42B9cBAr07UOmGcGdgMBhY1 /W3kRrAsiCxJDdw4gqyC1et5jZ179zsxw849SwAaBXkgqWk1ZJlydjqJmqREpmV34dz7 gapf8z7E0qPEG3/au+efEsYSw3uGfgBwjNqORfJuyo169womdeBfEwjGkgUKWOLObWrq imJA== X-Forwarded-Encrypted: i=1; AJvYcCUK1LgKbuAYXALsqi7C/LL6u28hcKEt01BAtOMOY2ZTOaKdzXhLbDg4ajKdu2sR65OIgy6eaiu4+zPuOb8=@vger.kernel.org X-Gm-Message-State: AOJu0YxOH8i9rps6CrxjXQxCSgTnsB3YCDYeNqTf/tTMmseaRoh8mCJA NUR3y68C70DK9sQXG0SxMs4tPebKqS8xHpNbTDlWeN6vGF3AwwIKsYhZFET5a2EPDlc= X-Gm-Gg: AZuq6aLK93gNODMNly9rgL83B7c3YwXex6RiWvTzdbNnHCFbRXuEu1LR4X5Cw3N1ZAm UUw+9BQdjlF1whQuoqErNG7ZfQKbLA4F1RUzuvzEbxFeS5xGPFEBNeRRhA/gUCeeUTHSdDCgm2L FrHscLsdFZ0hF6b29J6ryH45/9PPlhZ3PnP8BDttN9naU8svH/rBNkNKL1EMJsVGQ2vQsPOk5sy b4nGkMD0Et+8/2CBNomuM75VK+b7qPlz6xQk56wjNxcKFhrG2XJNU8A/pNhKA6NxhmK57t6ioU7 OC+zRRKR68ComHOUNK81UcgBi6JI81xeGBXKb040hxRa/EAJIHAYLiycnxgR26DcIW88e/uXzIR haJlBi0zB7JLlLIiP0EoxC5yzmfj3W0Ut75lz1MbsEDrpJ5zFU5GmVN5SA25lBEoWRr7w4mXzum AbgChFJUGSWy5UxZvmR1gBi3aO X-Received: by 2002:a05:600c:8b11:b0:47e:e2ec:9960 with SMTP id 5b1f17b1804b1-4805d06cdadmr105139335e9.35.1769449627682; Mon, 26 Jan 2026 09:47:07 -0800 (PST) Received: from localhost (109-81-26-156.rct.o2.cz. [109.81.26.156]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066bee000sm3831515e9.4.2026.01.26.09.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 09:47:07 -0800 (PST) Date: Mon, 26 Jan 2026 18:47:06 +0100 From: Michal Hocko To: Mathieu Desnoyers Cc: Andrew Morton , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Steven Rostedt , Masami Hiramatsu , Dennis Zhou , Tejun Heo , Christoph Lameter , Martin Liu , David Rientjes , christian.koenig@amd.com, Shakeel Butt , SeongJae Park , Johannes Weiner , Sweet Tea Dorminy , Lorenzo Stoakes , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , Christian Brauner , Wei Yang , David Hildenbrand , Miaohe Lin , Al Viro , linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, Yu Zhao , Roman Gushchin , Mateusz Guzik , Matthew Wilcox , Baolin Wang , Aboorva Devarajan Subject: Re: [PATCH v16 3/3] mm: Reduce latency of OOM killer task selection with 2-pass algorithm Message-ID: References: <20260114145915.49926-1-mathieu.desnoyers@efficios.com> <20260114145915.49926-4-mathieu.desnoyers@efficios.com> <0079bc61-5655-4677-a421-1a61f4c52d59@efficios.com> 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: <0079bc61-5655-4677-a421-1a61f4c52d59@efficios.com> On Mon 26-01-26 11:39:33, Mathieu Desnoyers wrote: > On 2026-01-16 16:55, Michal Hocko wrote: > > On Wed 14-01-26 14:36:44, Mathieu Desnoyers wrote: > > > On 2026-01-14 12:06, Michal Hocko wrote: > > > > On Wed 14-01-26 09:59:15, Mathieu Desnoyers wrote: > > [...] > > Thanks to those clarifications > > > > My overall impression is that the implementation is really involved and > > > > at this moment I do not really see a big benefit of all the complexity. > > > > > > Note that we can get the proc ABI RSS accuracy improvements with the > > > previous 2 patches without this 2-pass algo. Do you see more value in > > > the RSS accuracy improvements than in the oom killer latency reduction ? > > > > Yes, TBH I do not see oom latency as a big problem. As already mention > > this is a slow path and we are not talking about a huge latency anyway. > > proc numbers are much more sensitive to latency as they are regularly > > read by user space tools and accuracy for those matters as well (being > > off by 100s MB or GBs is simply making those numbers completely bogus). > > It makes sense. > > > > > It would help to explicitly mention what is the the overall imprecision > > > > of the oom victim selection with the new data structure (maybe this is > > > > good enough[*]). What if we go with exact precision with the new data > > > > structure comparing to the original pcp counters. > > > > > > Do you mean comparing using approximate sums with the new data > > > structure (which has a bounded accuracy of O(nr_cpus*log(nr_cpus))) > > > compared to the old data structure which had an inaccuracy of > > > O(nr_cpus^2) ? So if the inaccuracy provided by the new data structure > > > is good enough for OOM task selection, we could go from precise sum > > > back to an approximation and just use that with the new data > > > structure. > > > > Exactly! > OK, so based on your feedback, I plan to remove this 2-pass algo > from the series, and simply keep using the precise sum for the OOM > killer. If people complain about its latency, then we can eventually > use the approximation provided by the hierarchical counters. But let's > wait until someone asks for it rather than add this complexity when > there is no need. > > The hierarchical counters are still useful as they increase the > accuracy of approximations exported through /proc. > > How does that sound ? Works for me. Thanks! -- Michal Hocko SUSE Labs