Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E38D8C636CC for ; Mon, 13 Feb 2023 11:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230151AbjBMLDe (ORCPT ); Mon, 13 Feb 2023 06:03:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230096AbjBMLD1 (ORCPT ); Mon, 13 Feb 2023 06:03:27 -0500 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1388417173 for ; Mon, 13 Feb 2023 03:03:21 -0800 (PST) Received: by mail-il1-x135.google.com with SMTP id s9so3865687ilt.1 for ; Mon, 13 Feb 2023 03:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=I9smNmbml/2Z1XuxlO46/mzGZGe1qNudBrmiurlMq0I=; b=btEreWe/s17IA47Y8l9uW9sCT7m+lDsF1ol4e899b3Gs/XmjWsRrpj1tHkk/vivWlN vuSZmX7aMGCzFxkHDw1KCkt+FKf80BoxswjlZwoZIMXckjUnouGAi8+u8IhDA2J9GJVV /Y9RpvTD5d6BfYaSi+4/DdT/AzTU0rayIbb9aak26nDmjGobQ3afL/sYQiZqzD0R4ric Pq06hGn07LzOXq/714UbcjRa/xw514q8W5VDVhYy3L6RY3mxqF6nuQsDg8qsOETGXBsO OZKUjUayS1tBAY0D7TUl7A27J/qqLBSafqFhyaoqd2W/OWSjP+GekviVwYAz7uzuEgw2 hk9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=I9smNmbml/2Z1XuxlO46/mzGZGe1qNudBrmiurlMq0I=; b=ac2jtOaB7gxWLFUF/7WHV/wbJzw2uXgJlfZo3Gcw290K1sXAsR2L4Pf1hovfivWdF+ p6PQuHEqndh6loJYs41NyGg4umrT3BJhADkSqOw8o00C6tLNPMZZZbQXpBBbNohOEg+E OWBVdfsXi6mpcx1726Uu+RdXVbolHzR5t/+QMaBFCwLKUXwNSxG4pgJeaUGG9Fw3Ludj 8vGhyfzKPiRrgtttwoK0VLeO6cE9476WTnfvAb7t1kpp3dVV2sbpLl5TaT8zB0rudGQm BJmh2RS8I3smubAgmwA1HyQ+dQ17e5xMur8Li40nvnUCSgfH8VQS2hsAcEppMMTwWn3Y URgA== X-Gm-Message-State: AO0yUKUpUdlx3LSrxXHA/JUbj4g9r10EaSHRJ911xFaIYRmgw/TE4Nug ZyVRVeJxS9QQeW0+K0fIfkHj6eR1t93z2XSkx4/SFw== X-Google-Smtp-Source: AK7set9/1Xvhq2EEM3sZXotFmQ0DcCE7NLMJSFpUA4zHQbnV2TIscVDdL820r2kdAcg+kWozN+nCrQgaPpXe7c7SB50= X-Received: by 2002:a92:3f0c:0:b0:313:f6fa:bc50 with SMTP id m12-20020a923f0c000000b00313f6fabc50mr2367655ila.5.1676286200296; Mon, 13 Feb 2023 03:03:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Alexander Potapenko Date: Mon, 13 Feb 2023 12:02:39 +0100 Message-ID: Subject: Re: [PATCH v2 12/18] lib/stacktrace: drop impossible WARN_ON for depot_init_pool To: andrey.konovalov@linux.dev Cc: Marco Elver , Andrey Konovalov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 10, 2023 at 10:18 PM wrote: > > From: Andrey Konovalov > > depot_init_pool has two call sites: > > 1. In depot_alloc_stack with a potentially NULL prealloc. > 2. In __stack_depot_save with a non-NULL prealloc. > > At the same time depot_init_pool can only return false when prealloc is > NULL. > > As the second call site makes sure that prealloc is not NULL, the WARN_ON > there can never trigger. Thus, drop the WARN_ON and also move the prealloc > check from depot_init_pool to its first call site. > > Also change the return type of depot_init_pool to void as it now always > returns true. > > Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko