Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1375856rwb; Wed, 26 Jul 2023 11:28:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFIgodiCI+vuYB1w4jEZo0iQeK0nzyTRiYU0Jxjoj6XdGqcLcOzfCkocRuw9ghm13VnAc0F X-Received: by 2002:a05:6512:3707:b0:4f6:1b45:e8aa with SMTP id z7-20020a056512370700b004f61b45e8aamr1987642lfr.50.1690396086289; Wed, 26 Jul 2023 11:28:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690396086; cv=none; d=google.com; s=arc-20160816; b=Shw9dKoB5/BAfHvwWara1rEotXN9NLIFYZl7Gx+VeOYMZISCP6c2Lbndfzz30RFIgf w4Ukkd7hWhMzK9z1pf/EfogBbxCDjoAwYqmtju/wgfgvYUukaKeaEBqUKy0m+PXy72sk /HPleZNV1/c6IlTZrOmUBeNNu011WXaYrDlacxxW4xEmYcgTcJDDCvYQGrruDrZh9gYa B+n3YNm441ro7f5gGQjzRlT7ZnAzXk7Lm+MNWLao6AKidoXtBdSzUcl2Exvp8IenlKMZ PDKAxZM6Pc1YiYe5nA4DWNDvGlMx5cC/DIgrWD8HaErInuUZxyKnWQpPKCc2TANfIDQx 4d5Q== 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=bGK72/2uFFAFURzSmoidnNrT7qXYHkSsD+/Ej2DNnKc=; fh=3/rRYGUPYQxRDcbG2E7/uc5vuPcsOg/omPVA1hxJXbA=; b=mpBr5DXDwD6TE7QMmBG0yiQgOFtVzDTXUHwzyGB077wKeuVstMkrT1mmAE+1cE1VOF XgJVZ3IJ0iNFYFqUYD/AD8uIeAlGD1xSWMyYyL1vKknrlMdNnI9bwWKy2Fq1CQMMUhKW elf+olcv1IHA7pn5m2hLgkVvxTmEOEuC1NKCs8lUkJOwu0rqkI3sfpa7brG1xQU58AZI L5lUk2aHlry1u9k/7UTDdkGE+tGLe9m1QqNx/1CLlGl2ROCQC+/p/exCKeuGtWq9mAJb nyQmV6F1UGdiXlyqZOmG3uLmStOdIXH785PHehdVaCVGXEsMwARKfs2SnvCAXCa0ufVI D8LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=U5lXIfUU; 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 z3-20020aa7d403000000b005222780b1c4si5769766edq.600.2023.07.26.11.27.40; Wed, 26 Jul 2023 11:28:06 -0700 (PDT) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=U5lXIfUU; 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 S230109AbjGZSAF (ORCPT + 99 others); Wed, 26 Jul 2023 14:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbjGZSAD (ORCPT ); Wed, 26 Jul 2023 14:00:03 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 827A3212F for ; Wed, 26 Jul 2023 11:00:01 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99454855de1so1023253866b.2 for ; Wed, 26 Jul 2023 11:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1690394399; x=1690999199; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bGK72/2uFFAFURzSmoidnNrT7qXYHkSsD+/Ej2DNnKc=; b=U5lXIfUUGy5e/4L7t9jOX9ORyZWME7szPi9/JKMXUJwaj9/BvVhJA8vwZL09B9v85B 2CHK7NsPryrMaAlMhOvM4WkmaEDQbO0cabecWvCRmdsDz8qgtrq1y2XXOKzwYknbEBH+ x7+MNQ7j8rVSeJnd/vsdU6wNuqwejo2xLQGK0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690394399; x=1690999199; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bGK72/2uFFAFURzSmoidnNrT7qXYHkSsD+/Ej2DNnKc=; b=E1tmPHglVRu3EirlKpKa1eI+zqxIDlS4HhYC4DtPsfdGrIoJM24Dk/jI2zThDjBlzS Ope2V1Tl/nX9XkYdPd8m+Tko6Tl5clitrW1jGsBUn9ZoowBiCvF6MlW0UCDDTz5grZjf X2+G5+WVSX5vrm9NpZ+uGTh1Q6jRAHUh4xF2lj1iALLd18lTriFECMO4qKyEY4PbKqnP SywCkgiKoTbHttwrjDRKMZxiqap2QL+uRzf3H1xHrNkPA6UTVc5T8Q+DYpicgWraKm65 sdeOJj4YdajY+805BQWcjZE256JCYvaACoXp4rdMIvYeVC0OfXacqrnkkDm1oTY7xUkM dVMQ== X-Gm-Message-State: ABy/qLa8iaE5tdcd01277aSL8csfY9Aph2bLlMOResN1kUxTjoe3+WSm mrFGnYGemytduJIybzdNTKc48mb1nJaVYCpS/9nNjeEu X-Received: by 2002:a17:906:8251:b0:99b:5ba6:f2cf with SMTP id f17-20020a170906825100b0099b5ba6f2cfmr2395086ejx.26.1690394399697; Wed, 26 Jul 2023 10:59:59 -0700 (PDT) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com. [209.85.208.44]) by smtp.gmail.com with ESMTPSA id se13-20020a170906ce4d00b0099bce4ae3bfsm613885ejb.48.2023.07.26.10.59.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jul 2023 10:59:58 -0700 (PDT) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5227e5d9d96so50894a12.2 for ; Wed, 26 Jul 2023 10:59:58 -0700 (PDT) X-Received: by 2002:a05:6402:683:b0:522:2b76:1985 with SMTP id f3-20020a056402068300b005222b761985mr2046463edy.2.1690394398336; Wed, 26 Jul 2023 10:59:58 -0700 (PDT) MIME-Version: 1.0 References: <8d063a26-43f5-0bb7-3203-c6a04dc159f8@proxmox.com> In-Reply-To: From: Linus Torvalds Date: Wed, 26 Jul 2023 10:59:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: segfaults of processes while being killed after commit "mm: make the page fault mmap locking killable" To: Fiona Ebner Cc: "Eric W. Biederman" , Oleg Nesterov , akpm@linux-foundation.org, Thomas Lamprecht , Wolfgang Bumiller , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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 On Wed, 26 Jul 2023 at 01:19, Fiona Ebner wrote: > > Checking the status from waitpid, it does show that the process was > terminated by signal 9, even if the segfault was logged. Thanks for verifying. That's what I thought, and I had just entirely forgotten about the logging of failed page faults. This whole "fatal signals during IO can also cause a failed page fault" has been true for a long long time, but because it's done later by the actual VM code, there we actually end up going through "fault_signal_pending()" and suppressing the logging of the page fault failure that way. > > But before we revert it, would you mind trying out the attached > > trivial patch instead? > > The patch works for me too :) (after adding the missing tsk argument > like Thomas pointed out) So it turns out that not only did I forget the argument, I decided that I put that test for fatal signals in the wrong place. The patch obviously does fix the problem on x86, and we could do the same thing for all the other architectures that do this signal logging. But there's actually a much better place to put the fatal signal check, which will take care of all architectures: just do it in the 'unhandled_signal()' function. So I fixed the missing argument, and moved the test to a different place, but I still added your (and Thomas') "Tested-by:" even if you ended up testing something that was a bit different. Oleg, I took your Acked-by too. Despite the final patch being somewhat different. Holler if you see something objectionable. It's commit 5f0bc0b042fc ("mm: suppress mm fault logging if fatal signal already pending") in my tree now. And because it's a bit different from what you already tested, it would be lovely to just get a confirmation that I didn't screw anything up when I decided I needed to make a fix that covers more than just x86. Thanks, Linus