Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10503493rwl; Wed, 11 Jan 2023 21:48:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXtMjOAQW08Q6a/89S+gWos1PYMSdez53v49IEfYfL0oQs2WAeT0Q5YxQWHRYidXplgb7zwi X-Received: by 2002:aa7:c053:0:b0:482:e3b9:f46e with SMTP id k19-20020aa7c053000000b00482e3b9f46emr53573252edo.39.1673502495034; Wed, 11 Jan 2023 21:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673502495; cv=none; d=google.com; s=arc-20160816; b=nJTbfenzvejbDHJHWgbjkiQoh9BIV5wBP/gWB+XsqwXG54GsPuWh94bAzt38oC1CBc RcsmxxOqT8RRcFdz9+xvFEFm3LYA+dIIVao2ylhkc2tOw6roG6x1g1XuMo3cBmJICRbI 5Verrr9SvoN/7EKfELVWW7hm7nOn7/e6cW9WogjzK+DKPUdVp6vyy6cHklRXgMVQwivw ScFNV5wQ61LV3i46dGSngCMD5sX7Uxp7VYxj2dZkeQpVX0Htj3z2QbPe+8U06o5tnovu WwSavuAPnn0k5pvWJrpFhONjaQLwE+23B5/afJyHEbn2snRSE/Y/4a40WIuSOs8jR2mY 5OEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gT6BtwdEECaIxhj60fPhwvce6tvZ6jHeWjmgsh8Ypew=; b=yAxwhLhdnWCLx2rLifOd91fHHWGlS/Ygj0m3P6dbXAJ+Gcm8x/E5v+ztDO2v4DeYaR uEkjIg4lPGqWkll783TIgzKaHX5rQ5pa5f7ekWHtfWKyN3V6C5HlOkzeloTXffzavEHY GDnXzIh+rB6YvR92RmpHb2bBHyniSbv4+6/4K0SXRoM2YyXQIziccIpAX8ymf0cTb/qT uUtDfy8TXvhy/PyPkA8dvq3m4gOEYsEDdNhoW+p1+ZvD6ibCYIiZqp0Iy1TlvhFg/gRc SjGlGf0lsHEidYNr/aDbK619owGjKw9hDJJSnndA4066KbVTT21gySYWa35CVp7O07Ho Hsbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by6-20020a0564021b0600b0049553740b71si15147969edb.431.2023.01.11.21.48.02; Wed, 11 Jan 2023 21:48:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235894AbjALFOa (ORCPT + 51 others); Thu, 12 Jan 2023 00:14:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235111AbjALFO1 (ORCPT ); Thu, 12 Jan 2023 00:14:27 -0500 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C940042E3C for ; Wed, 11 Jan 2023 21:14:25 -0800 (PST) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 30C5Dguk020122; Thu, 12 Jan 2023 06:13:42 +0100 Date: Thu, 12 Jan 2023 06:13:42 +0100 From: Willy Tarreau To: Arseniy Lesin Cc: linux-kernel@vger.kernel.org Subject: Re: [RESEND RFC] SIGOOM Proposal Message-ID: <20230112051342.GB19712@1wt.eu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Jan 12, 2023 at 07:51:45AM +0300, Arseniy Lesin wrote: > 2.1. The SIGOOM Signal > ------------------ > > I propose the addition of new signal: SIGOOM (Out-Of-Memory SIGnal) > > This signal is intended to be sent to the most memory-hungry process(es) > in order to give process a chance to release memory used for > non-valuable data (for example, browser can unload tabs, that are > currently not in use, assuming tabs are not separate processes) or to > write down valuable data and exit gracefully (for example, some > graphical editor). > > Some applications can even set up a poll for OOM event by using signalfd > > Default action: IGNORE > Proposed senders: kernel- and user-space OOM-killers > > The technical detail of this addition is a bit unpleasant: there is > actually no room for new signals! Do this simpler, let userspace configure the signal it wants to receive for this via a new prctl(PR_SET_OOMSIG) and this would allow each process to voluntarily declare this intended behavior and the associated signal at the same time. There are already other comparable mechanisms existing there (signal to receive on parent's death, or on memory error for example). Willy