Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp255814pxt; Fri, 6 Aug 2021 00:54:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZveWJLyne80xDgdOpjYKYTXAP+RxenDqWODRLVBiWmxEqmDZ5+YuD5qmCl9z04oi78PSG X-Received: by 2002:a17:906:d54c:: with SMTP id cr12mr8710261ejc.227.1628236499765; Fri, 06 Aug 2021 00:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628236499; cv=none; d=google.com; s=arc-20160816; b=m17Dcd5Pas+u0deAnavY6DKgkk72RncIE0yE3RhQ6C+ZoU1tyw++QuuZTpdm2puhoh awG9dQPUOtpPe1IjX8FC5aN6pG7hNfjQ/25mya9k8yQyzzdMwiwjto5rN72pAGGrhQSj Ex8Y6Po5M9hBg0PKDQNdMMXq+dYUB8OjD7joFF13AyhbsfR6ij9G7HyfwlDN0MBw2vad u7F9iog4D84K16XswSJDL8E6D5wnQXuBgK7CTJ/NjGhLbvKgWcIK+UPY7mgkS3okXKYl f8hFum2TjqkZ9CH8DvPpm5vZHClGa+PlpcqE8/O6nS94rs0TTIHJFdqqvbyr0KCmmWv7 nCCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=L3TW/hbpU2iIogA7/HVgljoLbJH3MuJbKrYqp6bZxa8=; b=G4PhcG/r0fOyUYJcQRe4zRUyIYJAKe/zGRfxY1CuM/pnsCx4QGDg7AuNkycpjw6grq B9R09oYg6yozL3CGlYUHjWoxGmeMq5wo7GslFDnw1kqvyhPzBTRUHhWY9PW2zrkLOT9h RYS9KKYlwaMMaEYLYveGVc3zpJbLYd5VfEEEMhm2Y6C4LiGtIdTuIfxE/AJiuIIvhaBI XEVVC47K86WBecbTVK1/YQ9klAFEy8qvktdBSZfGKuu4LfLJYkWeYoBvJCHynKulbmGG cSmdj/N9T7O1k9EkVebzvPPeqQRQTOkNTNpFhPdJMIhD/zprMLm7Kt6ojUnhWgZXnLaj 2NXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=lcGg7DjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb37si8582186ejc.415.2021.08.06.00.54.36; Fri, 06 Aug 2021 00:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=lcGg7DjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243401AbhHFGmC (ORCPT + 99 others); Fri, 6 Aug 2021 02:42:02 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:55344 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbhHFGmB (ORCPT ); Fri, 6 Aug 2021 02:42:01 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 6B4D9223AD; Fri, 6 Aug 2021 06:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1628232105; 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=L3TW/hbpU2iIogA7/HVgljoLbJH3MuJbKrYqp6bZxa8=; b=lcGg7DjCd59pnNkutnkEqAUCpfRkb+2fqXYTowV1MgFCNq9kTkwmrTFxey1/CHITdFK8PR 8w/YX1C4MaaLQ/bnVpn3lSAxPaNjXCEqViCXRXq6j5H3izcB/1GkUsDh/q3x/dmwfYfyp0 mdUJfzAila9qn2TVoUc8Arqgr8gQdHA= 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 2DE98A3B87; Fri, 6 Aug 2021 06:41:45 +0000 (UTC) Date: Fri, 6 Aug 2021 08:41:44 +0200 From: Michal Hocko To: Suren Baghdasaryan Cc: Shakeel Butt , David Hildenbrand , Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Christoph Hellwig , Oleg Nesterov , Jann Horn , Andy Lutomirski , Christian Brauner , Florian Weimer , Jan Engelhardt , Tim Murray , Linux API , linux-mm , LKML , kernel-team Subject: Re: [PATCH v7 1/2] mm: introduce process_mrelease system call Message-ID: References: <20210805170859.2389276-1-surenb@google.com> <46998d10-d0ca-aeeb-8dcd-41b8130fb756@redhat.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 Thu 05-08-21 11:37:06, Suren Baghdasaryan wrote: [...] > > One question I have is why mmget() and not mmgrab()? I see mmgrab() in > > oom_kill.c. > > You are likely right here. The caller's context probably can't be > considered a "real user" when reaping the mm. However, we take an > mmap_lock shortly after, so not sure if in practice there is much > difference. > Michal, WDYT? As explained in other response. mmget is to pin address space to not go away. You do not need that for this purpose. All you need is to pin mm to not go away. Address space can be unmapped concurrently. -- Michal Hocko SUSE Labs