Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1779604pxu; Tue, 24 Nov 2020 08:45:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJze3hLuvv1UVfLJWL5DurdpRM/If3FQlV7zD0K5NjyUkqlMKay3yTicYFDfC+FtFe8aqLer X-Received: by 2002:a05:6402:54c:: with SMTP id i12mr4999199edx.9.1606236309241; Tue, 24 Nov 2020 08:45:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606236309; cv=none; d=google.com; s=arc-20160816; b=oogHn3FTAmg5Pqg7qAaAOfarsk+klHLku+YjouaZDm23VFST8ZK42zRcf64x33U7yL zHWvwFu/ePRVHioLf+W3OU0kpRPGbUx1a+zmuOjK47uRns4E2r32ZrfheQInxa5hial7 J+GMWAb4z2WoA5kH2hnHwdoDyzrmci/c6ZqOisqVVvPCDv3rPvs/gARw8roxmmFjM5pu poMwmv8iFd/8nclm7GkSdyG21FcIZvmJDFqcLPg0tTROGDzMi7Lxr5HVqAMXsBprAp5V ty2OTPXWPHnoPkCv++fTFFeVyLSteJfgWnjQQlOmL7+5DCTzuwA9rVk0fGkzJL7HG+CO Zerw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Dze+9qs3CL67LNyJlDApQNkdcs/suDR4TCdiUKUwE5A=; b=GoK9erQg7Zp2W/HvIEiIC3k5q1oGfWVLT/sq4mkGSp5U9rvxQMmKwsJOX7W1CRsI9L QNBHDYdy6Vs9r5JgWjUhw8UAlxI7PkiO7LW+DvohW/AyJR0QR3ekh2g8eL6QkVcuRl57 ZmXiOLKXWXWOAyUkrdLOkrtqtebW5efdQKRLt71lVPdg8sncI6SBjViOQeNee718b0E1 aK6XXo3aNgkluflDqkzoJmmcT7mdYNp5zH+JU0VQwCrnyrBWL/zSUMRLmbFw8gJGwcrn PR1Pt2B3aBrfoDR5JBC4luTqZToJnBOz2sz8FbM9Y1IpgVvrNIIx61E5b4jBHLnv86RQ Wn7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DgUQSmvf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si8829690ejx.84.2020.11.24.08.44.46; Tue, 24 Nov 2020 08:45:09 -0800 (PST) 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=@google.com header.s=20161025 header.b=DgUQSmvf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390562AbgKXQml (ORCPT + 99 others); Tue, 24 Nov 2020 11:42:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390522AbgKXQmk (ORCPT ); Tue, 24 Nov 2020 11:42:40 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90915C0617A6 for ; Tue, 24 Nov 2020 08:42:40 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id c198so2990420wmd.0 for ; Tue, 24 Nov 2020 08:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Dze+9qs3CL67LNyJlDApQNkdcs/suDR4TCdiUKUwE5A=; b=DgUQSmvfX7fcj/3ueVABOb2YXaTAq8629BfhnSrAL77wmv/G3WWdloicSJO1qOCAJE An5T26D2FAVMoBIz6OCinKOBY/et6yFth4/rVoMr4ny58VdfabCYwpqX9Cq3nAPjM16x cOcwWROrqmxs6Ce3c8uBhSOll9lsNQI+L3yJs2aeWjPO13YPkPFO1178al2F3L/MfcdK vhz9rctErIPnpLIXEENVY5medWEIduJF7kczhhGv6D4MfC47Vgi6emGa4GcqUbJj1MMh rn2DK+S86MHAinqNlC7Yd/iro/oGdg+R7jXngJ7I5wW6FAp2Sq+rhe/Acn/770MUE5/g FnZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Dze+9qs3CL67LNyJlDApQNkdcs/suDR4TCdiUKUwE5A=; b=Xx/Q0a4SkEKE9Pqs5ilx5NYQ7qipRxEuuANr5+0cCFNy0utdzsWWUC2Sgdp4weHCZC avIcdCics/amZmvbtv39x+l7Rr4MK2j98CNT7YgNzms5Bq3MAB5ewwB0LvlcJiW5PkkN 3PDC6E4cWzOmbKLbpoip2zIjgw8UEDTy67vcTd2q20WS2Ko65e68H1lIuhuj3OcNcr+X Z0jys0UBBc/QAG8VOISNcQUZhg3T5+N3qidHffLiSbhg4K+yuthcGmy6Iu0LGNcnsCnc IzW2S3ALzPeWfTmG+B7M/3JlT76DMZLWVoRZviDxuKXVDofY69pSLMyOCMcKkhiGlQY/ y0kw== X-Gm-Message-State: AOAM530Y/0BPEIDZnHW24IZbkqVQFh82XyAow7jf5CxAWx+04waWeOue JrbsjhZCi4tOHGx4vQ3EyOwgiDY/yV8bkT7E55c+CA== X-Received: by 2002:a1c:ba0b:: with SMTP id k11mr5298401wmf.37.1606236159094; Tue, 24 Nov 2020 08:42:39 -0800 (PST) MIME-Version: 1.0 References: <20201124053943.1684874-1-surenb@google.com> <20201124053943.1684874-3-surenb@google.com> <20201124134208.GA30125@redhat.com> In-Reply-To: <20201124134208.GA30125@redhat.com> From: Suren Baghdasaryan Date: Tue, 24 Nov 2020 08:42:28 -0800 Message-ID: Subject: Re: [PATCH 2/2] mm/madvise: add process_madvise MADV_DONTNEER support To: Oleg Nesterov Cc: Andrew Morton , Michal Hocko , Michal Hocko , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Tim Murray , linux-api@vger.kernel.org, linux-mm , LKML , kernel-team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 5:42 AM Oleg Nesterov wrote: > > On 11/23, Suren Baghdasaryan wrote: > > > > + if (madvise_destructive(behavior)) { > > + /* Allow destructive madvise only on a dying processes */ > > + if (!signal_group_exit(task->signal)) { > > signal_group_exit(task) is true if this task execs and kills other threads, > see the comment above this helper. > > I think you need !(task->signal->flags & SIGNAL_GROUP_EXIT). I see. Thanks for the feedback, Oleg. I'll test and fix it in the next version. > > Oleg. >