Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1332127rda; Mon, 23 Oct 2023 09:18:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFS7EBDhTwS0ahGwnBpGrkcY3Ye877EP3WK+ciMBj+x2wBkravmnFeST7N8DSFVCjIzL41a X-Received: by 2002:a05:6359:216:b0:168:ec64:8298 with SMTP id ej22-20020a056359021600b00168ec648298mr773635rwb.17.1698077932552; Mon, 23 Oct 2023 09:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698077932; cv=none; d=google.com; s=arc-20160816; b=zgfrEDyh0kZGoKbaflIPPONhQwNvIPjyCmbscrRP3GMltpjMryI5fmo4oyLrKo+Ftb PT2uSPXQhIeyhHIyCLX2AQqJmG6ANglGsLcJOurAodYB3NS8y83eE1QnGLi6VaVDFIOy bVut7jewzI/njy3rOEsKoof0tHDZzBfJRurzoCgWvNz+rN3eT990rBsPzz2dWTr0vkoH O92vJsPUXSeB3dtVsD7eRRurWSkq9rHs9bLwEKjrNBLqPFePYBe5D5FmK1L4OhMMwZRT 84u2AALYXYWuKeSFleu90Yjhe91MTSdor3os4SPOOgV/IjdyQJTW6TwCJ6ZQWPOGjNnN 2szg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6yATWwHsptne51eJuPF88jokz2oPp7uVzj/nBvs3wVg=; fh=UYz06EvMPMvknpMxEJVU33G5dgC6Oatp34wTBqbMcro=; b=g5CYm3aIEqFcc51e1m7Dr6tDFWrdCol7wHbkcyke2VFqAGPSlzZap0hBicMk5njZXv mIrQaNecsnlHZPZAZNezJzRe+tgb3BkHHfkF4VKz6Ej2VC/SmmoF84tceuN7Sy8euG3F wWsu08B184Dp9VjGIr0zC5d2OIYzJdRdfJYTwQXARbRCsA845E/QxKS7NNP6pyVntHDg a4Fnmp5rXFFFWkZhkojqEfoIvcU1XqDXrSYBZicw3083Gw5scq0/3OJYFP7ChKIEW5uY cCRlqEFjUL1FrskmB812VxlA+73bcUlAWWyatQcbac9Kva6lEhElICrti2iETrxNPrFE Jp2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hmfZgI86; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y14-20020a63ce0e000000b00578fcb85b89si6542985pgf.726.2023.10.23.09.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 09:18:52 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hmfZgI86; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5F9AB805E532; Mon, 23 Oct 2023 09:18:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233768AbjJWQSc (ORCPT + 99 others); Mon, 23 Oct 2023 12:18:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233499AbjJWQSO (ORCPT ); Mon, 23 Oct 2023 12:18:14 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29C0A10CB for ; Mon, 23 Oct 2023 09:17:53 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-5aed4f0e90bso1974122a12.1 for ; Mon, 23 Oct 2023 09:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698077872; x=1698682672; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6yATWwHsptne51eJuPF88jokz2oPp7uVzj/nBvs3wVg=; b=hmfZgI8641yBXOZP+ZTMleLdrrQwju7SpvGzcSQ+ozsP256J8enhB4F/7KkwOMOoq3 nWCIw3ziQRfTN6/unMIN9GILx+2F9EDEzOyySonKIjlxXaDbVvxL3RKs6iaA2p/9VgRd 3IijCzzSWmOmKLCSEnK1srQyGNQQNfyrWmHobHjjDTnJ9RS0m5Uiw5llDeOZRs3OT0Ne r5ty/37O+o5qXBkTUjYk6So5U+kv4RXnkctv+UCJ09LukS6BszGzguKeACfLcdUIz2SI UtwgQxoD6YJPIDKXXV8RSGNKd+x+GxcmmtfEBz04hh7qbma1NXHuR1zv/7W+cgIYCFwK zRYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698077872; x=1698682672; h=content-transfer-encoding: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=6yATWwHsptne51eJuPF88jokz2oPp7uVzj/nBvs3wVg=; b=wdIrIA4mS7PLSMRMf04y4dJeHaay66Kv2ut8nCwbR29U5k1v0nxrdFlJXN8+aMh9U7 3/39Re/dV0EuRfp6NbFBRvf9gndQS+0BCs4oDaXC0KpWx+m93zjhEOAj6T2/fjnZlRL9 /osSktT+UlmhENkP+BzDfRIW09flILrLVTC3fPtuqQEfB/uKhBKEUE+Sjy5zjtceRY1A WrJ2A+xXDg558Vlk1ZEOqfj6OHnordy1o7UDZmkNUQfykIzNX8t5MZ2IK1IfRksF+e+u Yz4xuanOBDrmFNYRALG4l2Jql6nknfUZ9VwnmPBEjSw+gh5mPpEUBB9RfUx+D36oD7Fn xZwA== X-Gm-Message-State: AOJu0YzofocDa15SNdUzCskN/yDiiwuEkPAoerjyZvqMIwOV95bHNv9i kenJtCxUfjTsIlxN0UCBkXeBbJrmPP0sGpjAQok= X-Received: by 2002:a17:90a:19c5:b0:27d:e73:3077 with SMTP id 5-20020a17090a19c500b0027d0e733077mr7197699pjj.1.1698077872354; Mon, 23 Oct 2023 09:17:52 -0700 (PDT) MIME-Version: 1.0 References: <20230916174334.GA1030024@mutt> <20230916130412.bdd04e5344f80af583332e9d@linux-foundation.org> In-Reply-To: From: Andrey Konovalov Date: Mon, 23 Oct 2023 18:17:40 +0200 Message-ID: Subject: Re: [PATCH v2 12/19] lib/stackdepot: use list_head for stack record links To: Alexander Potapenko , Anders Roxell Cc: Andrew Morton , andrey.konovalov@linux.dev, Marco Elver , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov , arnd@arndb.de, sfr@canb.auug.org.au Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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]); Mon, 23 Oct 2023 09:18:50 -0700 (PDT) On Mon, Oct 9, 2023 at 2:16=E2=80=AFPM Alexander Potapenko wrote: > > On Sat, Sep 16, 2023 at 10:04=E2=80=AFPM Andrew Morton > wrote: > > > > On Sat, 16 Sep 2023 19:43:35 +0200 Anders Roxell wrote: > > > > > On 2023-09-13 19:14, andrey.konovalov@linux.dev wrote: > > > > From: Andrey Konovalov > > > > > > > > Switch stack_record to use list_head for links in the hash table > > > > and in the freelist. > > > > > > > > This will allow removing entries from the hash table buckets. > > > > > > > > This is preparatory patch for implementing the eviction of stack re= cords > > > > from the stack depot. > > > > > > > > Signed-off-by: Andrey Konovalov > > > > > > > > > > Building on an arm64 kernel from linux-next tag next-20230915, and bo= ot > > > that in QEMU. I see the following kernel panic. > > > > > > ... > > > > > > The full log can be found [1] and the .config file [2]. I bisected do= wn > > > to this commit, see the bisect log [3]. > > I am also seeing similar crashes on an x86 KMSAN build. > > They are happening when in the following code: > > list_for_each(pos, bucket) { > found =3D list_entry(pos, struct stack_record, list); > if (found->hash =3D=3D hash && > found->size =3D=3D size && > !stackdepot_memcmp(entries, found->entries, size)) > return found; > } > > `found` is NULL > > @Andrey, could you please take a look? Found a bug, will fix in v3. Thank you!