Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp689947ima; Fri, 15 Mar 2019 11:51:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwv16skJ8l3O6ejhJEqcm2QKQdAXFuzrL0BjlGZkS4HsEuaxvn0BnjC2IWw/jGQc8IpU9cc X-Received: by 2002:a62:489d:: with SMTP id q29mr5474708pfi.119.1552675885370; Fri, 15 Mar 2019 11:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552675885; cv=none; d=google.com; s=arc-20160816; b=FlnSoFUlTbyLlE5jZYdOictjltUUHv9/zTRj45MPV4DAhTcyM9EUu/roRroprSfiAs jGAz6S1OhxTzj1qBU6AAHHoSbSsh6tThsCY+fcKKLSe32CQ2XITbFuo3oB4c/bTeaNp8 pbXhxwBXy4lRkvR7rNDhYE7w304bWz6G56FIdF9lzQ4eO5iexQ8dRauJOrXsHKy1IraA FiL1jQSaxZjltXSMK/jTblyn68RQeoBoc6CCbhs3vB9u5BWA8/PNyQUopqUQvP/5RCLu wJzTrJ9iqzGINJpdzIU53Bg7LcKELoeyAlWewu1qPmPMRPDwOVe4GDTuI4EQ5UchimGN Fydg== 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=jDVu9oumcNkqVWq1A9ByqO3eErH+1lF+kli+4UwjDSo=; b=VYBRzdDZ+tq0+aQsxfegUBseBrvLfaMk+xMQrBd6fXrQbB7F76Hg1BN7lgChlI5EYI fBjnacJTokvniy38I6uxIlGhYyXakrmHOQ1k5CyrqTS4hCjV7dtR/q5AvI9cZ7waCEMH ggc9KK6UfTM4wmNRVSUEmUjX/fSnExy2NI12NXDcM1m3lY2kZvQsmJNNcAUbRST8cbc/ HojI6rcHXNcVcrok3SBfv55rCLBNyFOYnPAK6TY0NG/20NidpVshLrUAVGjxvsKvU6tG didan7QAPkjXR206mpK0IiXNXwPsaTMOnqHmN6+m8WlUqGa4wvo3lF5jX6mLGVXqMKID 3pFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=XlCmr86N; 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 cm10si2487089plb.295.2019.03.15.11.51.09; Fri, 15 Mar 2019 11:51:25 -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=@joelfernandes.org header.s=google header.b=XlCmr86N; 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 S1726684AbfCOStH (ORCPT + 99 others); Fri, 15 Mar 2019 14:49:07 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:40513 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbfCOStG (ORCPT ); Fri, 15 Mar 2019 14:49:06 -0400 Received: by mail-qt1-f195.google.com with SMTP id f11so11236101qti.7 for ; Fri, 15 Mar 2019 11:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jDVu9oumcNkqVWq1A9ByqO3eErH+1lF+kli+4UwjDSo=; b=XlCmr86Nfgg3xBxju2EZKTlTIuahwPKKbKnb6AAlhmp/tbiXOHmzB9Z4TTY65xaPhY h4du8n5E8MqaLaMPiBzkN0MAjbdzjR75E/AcT2yQNsgUl/sytZ2UHw3nW5f5SaJzdt7G qzWXFPPAMKCh8WrfHRT1c/0etmimiPLKZ6KAE= 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=jDVu9oumcNkqVWq1A9ByqO3eErH+1lF+kli+4UwjDSo=; b=aLXP+3uZxna3cexEKi40FKjnH/yQVi8A/TNd26OfoevAUEwt1TmPwT001ar0dz8p0Y AFcAkd0cjzzClVpYVZlJy/ApZyCCrcCIZeDHBURtIoA3RjUnFtxkhWXR+wGzY281gODy rND9EAGHclBUh2JBfaNdeZeTHAORyGyKyfVUv2uzxWA4794Mn5jsKGTDMBHF2eNi+6y9 8UUtSg3ZpDoVuRwubjoyXQzkEUERr9puIUxHzb8dTEgOzmihFiWwq9KHXVVtqj4UEZ0D S7TVuT/7fwyVOrHPFEbu4HP5M1iD/BHtlKkBN23Wj1/VZyuqaOwDQD6V0ceqm/KT5eOA JhlA== X-Gm-Message-State: APjAAAXdQSFUCUDlOKL7DP7EumhWDR6ivP8z1vcg5oc2LvYILPFsmzVe qYJRCHdtkbFgIf/EYhpk05dZEQ== X-Received: by 2002:ac8:3042:: with SMTP id g2mr4025863qte.1.1552675745275; Fri, 15 Mar 2019 11:49:05 -0700 (PDT) Received: from localhost ([2620:0:1004:1100:cca9:fccc:8667:9bdc]) by smtp.gmail.com with ESMTPSA id m88sm1384596qte.68.2019.03.15.11.49.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 11:49:04 -0700 (PDT) Date: Fri, 15 Mar 2019 14:49:03 -0400 From: Joel Fernandes To: Christian Brauner Cc: Daniel Colascione , Steven Rostedt , Sultan Alsawaf , Tim Murray , Michal Hocko , Suren Baghdasaryan , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Ingo Molnar , Peter Zijlstra , LKML , "open list:ANDROID DRIVERS" , linux-mm , kernel-team Subject: Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android Message-ID: <20190315184903.GB248160@google.com> References: <20190312080532.GE5721@dhcp22.suse.cz> <20190312163741.GA2762@sultan-box.localdomain> <20190314204911.GA875@sultan-box.localdomain> <20190314231641.5a37932b@oasis.local.home> <20190315180306.sq3z645p3hygrmt2@brauner.io> <20190315181324.GA248160@google.com> <20190315182426.sujcqbzhzw4llmsa@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190315182426.sujcqbzhzw4llmsa@brauner.io> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 15, 2019 at 07:24:28PM +0100, Christian Brauner wrote: [..] > > why do we want to add a new syscall (pidfd_wait) though? Why not just use > > standard poll/epoll interface on the proc fd like Daniel was suggesting. > > AFAIK, once the proc file is opened, the struct pid is essentially pinned > > even though the proc number may be reused. Then the caller can just poll. > > We can add a waitqueue to struct pid, and wake up any waiters on process > > death (A quick look shows task_struct can be mapped to its struct pid) and > > also possibly optimize it using Steve's TIF flag idea. No new syscall is > > needed then, let me know if I missed something? > > Huh, I thought that Daniel was against the poll/epoll solution? Hmm, going through earlier threads, I believe so now. Here was Daniel's reasoning about avoiding a notification about process death through proc directory fd: http://lkml.iu.edu/hypermail/linux/kernel/1811.0/00232.html May be a dedicated syscall for this would be cleaner after all. > I have no clear opinion on what is better at the moment since I have > been mostly concerned with getting pidfd_send_signal() into shape and > was reluctant to put more ideas/work into this if it gets shutdown. > Once we have pidfd_send_signal() the wait discussion makes sense. Ok. It looks like that is almost in though (fingers crossed :)). thanks, - Joel