Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp947812rdh; Fri, 24 Nov 2023 01:37:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOln/o6VAnOHoHZ4pi1iuPyq1BP/vHzhrq+WTYqrfFLnGR28mVelEugB4j6vLsb4JB8Dkf X-Received: by 2002:a05:6a20:8401:b0:18b:9f43:7d75 with SMTP id c1-20020a056a20840100b0018b9f437d75mr2806770pzd.17.1700818665713; Fri, 24 Nov 2023 01:37:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700818665; cv=none; d=google.com; s=arc-20160816; b=HzDjHEEEplkoC2JUbT9zFRIKvEX5YBKrRDhMuVpM9kX2eM4UBsKhD+AGID03EINi0e k1fbcVGJ8OZhIbQIzrHTBgW5x6pKL7yk/lFUEb6WRkKcYPRG6Qeo9m1NOhoAroKiPEI4 w/ScCGvWGr/2CXH2lRlAOYLTli7EgsFqrVYXFhFg3b525BDWMX7CFqmfWuTDBZCdYcqZ 9bdJSg51TTbAsrldrIlb/mxEsp3JlJcHCvDbt9EWSGv+sebU81sXGRLMMG5g3dXfFIx4 3bDMtc3HCPH6Vy9qj9TWOtztFtG2FN1GDv+MIryJlkZ/9NjIUSWkepQi3ND1vcDq++zM KcXA== 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; bh=NFntWWMjiEdn/UTqK8kJkwxbqrPHHhjDdu/JVlrrN+A=; fh=zajka3zRgaI922RGgVyR2eQBoE+gi6qysB/Soxo/DKg=; b=y1jTSWP3wiSZHZfgrnHbO9+tI+Eiw4UjUDpt1H1z+SlT5wRKI+qc/MU5Zv3IdFd7hv AOaHqMC0t3swHJbFg+dTd1qAaNTajFnQnHLlNukI/XT9FbR+BTT1UcF7KgDhg8RspyMc Sc0d20Ad7eqBWfXkD9JcVXuZrNZ5I92NDCsJmKm/GbWoXF4KgFKkrNzXvLnU9HTaShnH dCBuB6KEhCUi6xgeiRxiMcLAq2H5J47jHxzupk4Y/G5xDIgGJ3ZtDkWhuHuVqePFXfj5 llKPmulQzvSggymMBrSw4GnXp4U4XC3YOyMyB+RGMJKu5Dzu6TgDBdNQId8nm+zFyzNZ DYvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id mr21-20020a17090b239500b002803298b98asi3639793pjb.43.2023.11.24.01.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 01:37:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AD49D80A139F; Fri, 24 Nov 2023 01:37:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjKXJhW (ORCPT + 99 others); Fri, 24 Nov 2023 04:37:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbjKXJhU (ORCPT ); Fri, 24 Nov 2023 04:37:20 -0500 X-Greylist: delayed 397 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 24 Nov 2023 01:37:26 PST Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F34F8EA for ; Fri, 24 Nov 2023 01:37:26 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EF9371FB67; Fri, 24 Nov 2023 09:30:45 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C798713A98; Fri, 24 Nov 2023 09:30:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id E3/PLEVtYGXOZgAAD6G6ig (envelope-from ); Fri, 24 Nov 2023 09:30:45 +0000 Date: Fri, 24 Nov 2023 10:30:44 +0100 From: Michal Hocko To: Andrew Morton , gaoxu Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Suren Baghdasaryan , yipengxiang Subject: Re: =?utf-8?B?5Zue5aSNOiBbUEFUQ0hdIG1tLG9v?= =?utf-8?B?bV9yZWFwZXI6?= avoid run queue_oom_reaper if task is not oom Message-ID: References: <400d13bddb524ef6af37cb2220808c75@hihonor.com> <242025e9a8c84f6b96ba3f180ea01be9@hihonor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <242025e9a8c84f6b96ba3f180ea01be9@hihonor.com> Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd1 X-Spam-Level: X-Rspamd-Queue-Id: EF9371FB67 X-Spam-Score: -4.00 X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 01:37:37 -0800 (PST) On Fri 24-11-23 03:15:46, gaoxu wrote: [...] > >> [3701:11_see]Unable to handle kernel NULL pointer dereference at > >> virtual address 0000000000000328 [3701:11_see]user pgtable: 4k pages, > >> 39-bit VAs, pgdp=00000000821de000 [3701:11_see][0000000000000328] > >> pgd=0000000000000000, > >> p4d=0000000000000000,pud=0000000000000000 > >> [3701:11_see]tracing off > >> [3701:11_see]Internal error: Oops: 96000005 [#1] PREEMPT SMP > >> [3701:11_see]Call trace: > >> [3701:11_see] queue_oom_reaper+0x30/0x170 > > > > Could you resolve this offset into the code line please? > Due to the additional code we added for log purposes, the line numbers may not correspond to the original Linux code. > > static void queue_oom_reaper(struct task_struct *tsk) > { > /* mm is already queued? */ > if (test_and_set_bit(MMF_OOM_REAP_QUEUED, &tsk->signal->oom_mm->flags)) //a null pointer exception occurred > return; Did you manage to narrow it down to which of the dereference this corresponds to? Is it tsk->signal == NULL or signal->oom_mm == NULL. The faulting address doesn't match neither with my configs. [...] > >> --- a/mm/oom_kill.c > >> +++ b/mm/oom_kill.c > >> @@ -984,7 +984,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) > >> } > >> rcu_read_unlock(); > >> > >> - if (can_oom_reap) > >> + if (can_oom_reap && tsk_is_oom_victim(victim)) > >> queue_oom_reaper(victim); > > > > I do not understand. We always do send SIGKILL and call mark_oom_victim(victim); on victim task when reaching out here. How can tsk_is_oom_victim can ever be false? > This is a low-probability issue, as it only occurred once during the monkey testing. > I haven't been able to find the root cause either. OK, was there any non-standard code running during this test? In any case I do not see how this patch could be correct. If, for some reason we managed to release the signal structure or something else then we need to understand whether this is a locking or reference counting issue. I do not really see how this would be possible. But this check right here doesn't really make sense. Andrew please drop the patch from your tree. -- Michal Hocko SUSE Labs