From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1753C432BE for ; Wed, 4 Aug 2021 06:21:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D508660F6F for ; Wed, 4 Aug 2021 06:21:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235563AbhHDGVg (ORCPT ); Wed, 4 Aug 2021 02:21:36 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:36882 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbhHDGVf (ORCPT ); Wed, 4 Aug 2021 02:21:35 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BA5C822139; Wed, 4 Aug 2021 06:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1628058081; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J26bRC9AqL9yzAXTcNmpFXfcnAuaPb5GeWdDw/9Ibro=; b=PrH3TePlw7r5kZOL2S/iTUbxAUPK0XpagG2SryHdrg0f8+d1Srw0oXSrsPXXpXzrBiLWAr JC0zwPOk5NYaUwnBlfO7vYOiLjZPq45XJbCZrvj9Ck0uAyMA52dSopLxTZnlGrIZ2dsNS7 qRsHFG/D6pACnxLt5b8rF7EiuBaZKlg= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id F2469A3B84; Wed, 4 Aug 2021 06:21:20 +0000 (UTC) Date: Wed, 4 Aug 2021 08:21:12 +0200 From: Michal Hocko To: Suren Baghdasaryan Cc: Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , David Hildenbrand , Jann Horn , Shakeel Butt , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Tim Murray , Linux API , linux-mm , LKML , kernel-team Subject: Re: [PATCH v4 1/2] mm: introduce process_mrelease system call Message-ID: References: <20210802221431.2251210-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 03-08-21 15:09:43, Suren Baghdasaryan wrote: > On Tue, Aug 3, 2021 at 10:27 AM Suren Baghdasaryan wrote: [...] > > > > + if (task_will_free_mem(task) && (task->flags & PF_KTHREAD) == 0) { > > > > + mm = task->mm; > > > > + mmget(mm); > > > > + } > > > > + task_unlock(task); > > > > + if (!mm) { > > > > > > Do we want to treat MMF_OOM_SKIP as a failure? > > > > Yeah, I don't think we want to create additional contention if > > oom-killer is already working on this mm. Should we return EBUSY in > > this case? Other possible options is ESRCH, indicating that this > > process is a goner, so don't bother. WDYT? > > After considering this some more I think ESRCH would be more > appropriate. EBUSY might be understood as "I need to retry at a better > time", which is not what we want here. Why cannot we simply return 0 in that case. The work has been done already by the kernel so why should we tell the caller that there was something wrong? -- Michal Hocko SUSE Labs