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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 0D64CC388F7 for ; Tue, 3 Nov 2020 21:29:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8437A2236F for ; Tue, 3 Nov 2020 21:29:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="iugY1zHx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8437A2236F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D20D16B006E; Tue, 3 Nov 2020 16:29:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C81236B0070; Tue, 3 Nov 2020 16:29:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4EB06B0071; Tue, 3 Nov 2020 16:29:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 8141F6B006E for ; Tue, 3 Nov 2020 16:29:04 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 26C6F824999B for ; Tue, 3 Nov 2020 21:29:04 +0000 (UTC) X-FDA: 77444397408.21.humor48_5004f0e272bb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 0569A180442C2 for ; Tue, 3 Nov 2020 21:29:03 +0000 (UTC) X-HE-Tag: humor48_5004f0e272bb X-Filterd-Recvd-Size: 4673 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Nov 2020 21:29:03 +0000 (UTC) Received: by mail-wm1-f46.google.com with SMTP id c16so605640wmd.2 for ; Tue, 03 Nov 2020 13:29:03 -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=coCVSzogN7FhufO26SBDPdyABYAN7DRvbWuTG3U17pI=; b=iugY1zHxj+rcoEypRyKobqPHp2mh1vGfJXqR12Xn7NjuNH1nJWgfMn2R9Vnetqh2gm biK82RCbDxhSsRJqM2JNMXFRHP7Q/f6H5OXNd1LF8QScpPd1dJWuyshd2FRZZyx/vWxM Bik3sNu0e+0j6yAyP+Q6lDYLfE6y8ro4eBGZXSEcQ51LDOTZ/I+6imS3zV10kdZtIW1K GykTfekQlxVHsmHkwb9UW0G80BB06wmmU8mvqe2BxzQECn6D4slUc2M7abwJGMwKKUsx /tsZbgQfH2/MLDidcnifIEMiCMDEQPoOhaYvh8AHffReKHVQEQRY/Wp77I0V3TF6bceH 7pdw== 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=coCVSzogN7FhufO26SBDPdyABYAN7DRvbWuTG3U17pI=; b=Yi6AMt3Z6wZhfGc65Y7kTKrx+NOescdzBJQfxsQNpH/ZIWzp0P4kcg2zuPa8J5DTv2 QSyNohp8OIS8V16Ms01AQplyAknM2EE76pKt9fx4dp8GoyxxeueS+FkBMpF4SrC75yZw oncCgVdvQzO/sU0DhC4fPPDQuD/4H7fxGm9pLZUeD7I+e29dunocYYwcUunz1cPExSeM NlW02gf8ovRC8ekWXbc/R89hYyrmuOtWln/9P5rbVjPgARZJ/8Bq7YnxjCHB+EeQsT7I P54mnik+c1L5HUo0d9B4viAEk72DJS5f+zZxdt0I+p9ppQtpgCsRY/HeSF/pQz4LxXxV 7lzw== X-Gm-Message-State: AOAM531GE0TaTePLOBmfZ/JzjnzCKI4aJ46gRB8YlISxS5Miw9Y6lKsE WvL9lJDVZFVVtMFm+ZhnywSzx/kYH6tuzxssFS9X5CeImPX7Bpmy X-Google-Smtp-Source: ABdhPJwjZHXUS+ZXtJZWnGUnzGmYa3rlxOLjOWvm9qm54qf9JdTinBsnwxtE8GcZ/WkZB9KXdiiMVPoCZKZAMvh9tOk= X-Received: by 2002:a1c:1b85:: with SMTP id b127mr1167531wmb.163.1604438942285; Tue, 03 Nov 2020 13:29:02 -0800 (PST) MIME-Version: 1.0 References: <20201014120937.GC4440@dhcp22.suse.cz> <20201015092030.GB22589@dhcp22.suse.cz> <20201103093550.GE21990@dhcp22.suse.cz> In-Reply-To: <20201103093550.GE21990@dhcp22.suse.cz> From: Suren Baghdasaryan Date: Tue, 3 Nov 2020 13:28:51 -0800 Message-ID: Subject: Re: [RFC]: userspace memory reaping To: Michal Hocko Cc: linux-api@vger.kernel.org, linux-mm , Andrew Morton , David Rientjes , Matthew Wilcox , Johannes Weiner , Roman Gushchin , Rik van Riel , Minchan Kim , Christian Brauner , Oleg Nesterov , Tim Murray , kernel-team , LKML , Mel Gorman Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 3, 2020 at 1:35 AM Michal Hocko wrote: > > On Mon 02-11-20 12:29:24, Suren Baghdasaryan wrote: > [...] > > To follow up on this. Should I post an RFC implementing SIGKILL_SYNC > > which in addition to sending a kill signal would also reap the > > victim's mm in the context of the caller? Maybe having some code will > > get the discussion moving forward? > > Yeah, having a code, even preliminary, might help here. This definitely > needs a good to go from process management people as that proper is land > full of surprises... Hmm. Adding a new SIGKILL_SYNC seems to require quite a surgery... That will cause a change to SIGRTMIN which is used by glib and also would affect RTSIG_MAX which I think is also used by the userspace. I'm not sure such a change would be acceptable... IIUC, Minchan's alternative suggestion was to do mm reaping from inside fsync() in cases like these: pidfd_send_signal(pidfd, SIGKILL); // send SIGKILL as usual fsync(pidfd); // causes mm reaping in the context of the caller I can prototype this approach quite easily and quickly and post an RFC to energize the discussion. Any objections? > -- > Michal Hocko > SUSE Labs