Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3592430yba; Tue, 7 May 2019 04:00:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo7qGEaDaDuGO82BSol04ZVO70nOiAJF4sx4Wy1N3w9GKhiAEc2ryZ0w761BSb2HgSzMBw X-Received: by 2002:a63:9dc8:: with SMTP id i191mr38007607pgd.91.1557226846446; Tue, 07 May 2019 04:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557226846; cv=none; d=google.com; s=arc-20160816; b=XLd4LThrHklwzny6jRx7faEWumx9Q+o6hip/WTvain8kNeeHyjCRswGTuJmVDuran/ lA5Xk+lJ1pWQ5nPRUuKxJiQ4byhlDRcXx7wgWvOjTOahbaXmyQ/Qsjdy4mAMxqgKbvzP zeuByoytPjKm+x6z2Di3EsKTlcft+mIjZmcry0FxU9brCCbwV5OgeUCEvUKYnKT0KUfu 0WzgFep0UOYLgpYk5rFUoBHsiA0eM5AaqZQSQ2adEWwILiEWAHZuJCbBQDRATzukacue xPciKM5hRk7iUjn6h9Gz/iSp1m5iN+2l8GpyOD9gj9MFuBwkGady8u12k6J1RIvKbS2x 2WZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1HC/MUgf456zJfRJXUVVgg6o0d0M1B+L7QMi6llJ2Bo=; b=dojwn46uyHUoWAUBTclbb8jkI7lU61HtkSlcTzF8YWRz/Lt9D0huVvvSm6u18eme/V 6whKa8hoWPkMZNXgyXnygdTqJENDTsrWUuHGptPCAj5NYq2xV7Yz2OOq3JVnS3BXZx/5 WEqfzNOWq8VunrMXI5Ot1GWr+U6k3xXh67dNNWlswyXYXXn/IN/zFU97n0UjXXlaWCZx V7G2pU6SWBoMX3EbjAcy4fcCth76t0Vsto3sdEC57L+UzRHTjyPozbcLX5wlfMzlfuQO taO1eLpvbIzDeeZMdQps07tdpr8ad5BIMxH/DupYSKoalrgFJZpDGvJ+WmA7ttlVj4+6 E4Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=E+YVKccV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36si18579733pgw.281.2019.05.07.04.00.30; Tue, 07 May 2019 04:00:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=E+YVKccV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbfEGK6c (ORCPT + 99 others); Tue, 7 May 2019 06:58:32 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:41573 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726095AbfEGK6b (ORCPT ); Tue, 7 May 2019 06:58:31 -0400 Received: by mail-ed1-f66.google.com with SMTP id m4so18296060edd.8 for ; Tue, 07 May 2019 03:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1HC/MUgf456zJfRJXUVVgg6o0d0M1B+L7QMi6llJ2Bo=; b=E+YVKccV3crljzyzQRgZ+qVmjGAxpSmba/m9j8r8NgrA34RUFop5bvNMjUbDwOuRNB b32+Jl/qjNWnlvTDYyTs/KeVx58V71F7zbu28ARzlDJFrza6g9g8Zi8OL55OmDTkgfSl 1BGDJtAmk2ERpdEdX2xDcrPZ80zvjefZo+oei1Mm2khGrth/UBL1A1VFwvbheFqAlcQ8 9JSttdgh0BDB+Z/aTtQZkNW6+cetIuH9iCeGfDRIqCOLydg98GdTqe6LAdP4iTh2ppDw LsM9hKBQMNpP2ECL1fjkX6fYcURKheF5cqWjXseRus2cycqTaunLSVR2osQqCa3I6n/H lrLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1HC/MUgf456zJfRJXUVVgg6o0d0M1B+L7QMi6llJ2Bo=; b=gv+gh3k7NK0cmBJGFAzud/Lo/uJrrETjZf6Z+M4uP/NBKRl9FTJwnu3MJVB61EGpaK hGEVqYr1ZUOjY1SkffZsOTJ2BMDByjRCwIUGb6uH9DiB/MJVg6RjUQowSfAjGb4HBv6n zyXUCe4UfFalju1IiQCx2mgQ+QZqGD4fe51oqBksuWovam9NHQi4rwpJvlAL3d/JMAn0 uEhLK7BjKWJf3iW9TIhBTjwcnRNYaommgg6Jp+yeEeQFreuLk+7MzoC6Lj+f1CQCpe1I g8BKw/6IvzitrNYRlprL6rd1qyF/1w2Lj/Vl4r35T+y3JJFXld/qwu2DP6ELgqVLXSC9 4u7A== X-Gm-Message-State: APjAAAVoKjD60kao1abd1jkIzrRcQw4JShbnStUWKmjMjob37rBfLZ40 HxKRXYo3hs0L3bl7EOwZ4ftSHw== X-Received: by 2002:a50:885b:: with SMTP id c27mr31844820edc.155.1557226709457; Tue, 07 May 2019 03:58:29 -0700 (PDT) Received: from brauner.io ([178.19.218.101]) by smtp.gmail.com with ESMTPSA id w14sm4048277eda.18.2019.05.07.03.58.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 07 May 2019 03:58:28 -0700 (PDT) Date: Tue, 7 May 2019 12:58:27 +0200 From: Christian Brauner To: Sultan Alsawaf Cc: Greg Kroah-Hartman , "open list:ANDROID DRIVERS" , Daniel Colascione , Todd Kjos , Kees Cook , Peter Zijlstra , Martijn Coenen , LKML , Tim Murray , Michal Hocko , Suren Baghdasaryan , linux-mm , Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , Ingo Molnar , Steven Rostedt , Oleg Nesterov , Joel Fernandes , Andy Lutomirski , kernel-team Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android Message-ID: <20190507105826.oi6vah6x5brt257h@brauner.io> References: <20190318235052.GA65315@google.com> <20190319221415.baov7x6zoz7hvsno@brauner.io> <20190319231020.tdcttojlbmx57gke@brauner.io> <20190320015249.GC129907@google.com> <20190507021622.GA27300@sultan-box.localdomain> <20190507070430.GA24150@kroah.com> <20190507072721.GA4364@sultan-box.localdomain> <20190507074334.GB26478@kroah.com> <20190507081236.GA1531@sultan-box.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190507081236.GA1531@sultan-box.localdomain> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 07, 2019 at 01:12:36AM -0700, Sultan Alsawaf wrote: > On Tue, May 07, 2019 at 09:43:34AM +0200, Greg Kroah-Hartman wrote: > > Given that any "new" android device that gets shipped "soon" should be > > using 4.9.y or newer, is this a real issue? > > It's certainly a real issue for those who can't buy brand new Android devices > without software bugs every six months :) > > > And if it is, I'm sure that asking for those patches to be backported to > > 4.4.y would be just fine, have you asked? > > > > Note that I know of Android Go devices, running 3.18.y kernels, do NOT > > use the in-kernel memory killer, but instead use the userspace solution > > today. So trying to get another in-kernel memory killer solution added > > anywhere seems quite odd. > > It's even more odd that although a userspace solution is touted as the proper > way to go on LKML, almost no Android OEMs are using it, and even in that commit That's probably because without proper kernel changes this is rather tricky to use safely (see below). > I linked in the previous message, Google made a rather large set of > modifications to the supposedly-defunct lowmemorykiller.c not one month ago. > What's going on? > > Qualcomm still uses lowmemorykiller.c [1] on the Snapdragon 845. If PSI were > backported to 4.4, or even 3.18, would it really be used? I don't really > understand the aversion to an in-kernel memory killer on LKML despite the rest > of the industry's attraction to it. Perhaps there's some inherently great cost > in using the userspace solution that I'm unaware of? > > Regardless, even if PSI were backported, a full-fledged LMKD using it has yet to > be made, so it wouldn't be of much use now. This is work that is ongoing and requires kernel changes to make it feasible. One of the things that I have been working on for quite a while is the whole file descriptor for processes thing that is important for LMKD (Even though I never thought about this use-case when I started pitching this.). Joel and Daniel have joined in and are working on making LMKD possible. What I find odd is that every couple of weeks different solutions to the low memory problem are pitched. There is simple_lkml, there is LMKD, and there was a patchset that wanted to speed up memory reclaim at process kill-time by adding a new flag to the new pidfd_send_signal() syscall. That all seems - though related - rather uncoordinated. Now granted, coordinated is usually not how kernel development necessarily works but it would probably be good to have some sort of direction and from what I have seen LMKD seems to be the most coordinated effort. But that might just be my impression. Christian