Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4881965rdb; Fri, 15 Sep 2023 15:41:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqiu0QUgUAkortbZAUiWWL72VEgb1ot4nRyEfQwGPDkyEEYEWnyxde4VZJtQi8+WPN3jlJ X-Received: by 2002:a05:6358:6f81:b0:135:acfd:8786 with SMTP id s1-20020a0563586f8100b00135acfd8786mr2139564rwn.3.1694817687310; Fri, 15 Sep 2023 15:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694817687; cv=none; d=google.com; s=arc-20160816; b=nemAkAoWqMdbjHCtSZD8333yNBF+TPMPD/W4NqYURW2Z66uqaMGxE9Y+AdUOyzIuBh bH0MHqsfBz4jqc7dWG3ZtTHdGkTIrY0gFPWvLXwKHt6Mv/QI3dmf2927KkdH3uVdaDFN VJfH8RAhhqCnpOnqHDY+6LissWfevGu74fNoNGs9ACfB+u92OfeRptnGfEteaNAi0yET oPqTETopS3e1dwNGry9u/7CRT7TOS7dUbHmBU1vmZkTqoqVKJPii57+0VCHtF1ypmhzf Vhh5VrRrAUXam998XHGf9E683Gj/pXL79htOghxaGtwn07vfcW3Ukph9g9y6J3fE5Oe5 pT0A== 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=yePpIdQ7WZGAqEgEwzbub2QYZTvPnhatZu9Hi1ymeRU=; fh=WZm5FIwGteWwMu2FxC70OasHBljMKC5DV64VGPj6Alo=; b=ZkW+Cvb7z5MDH3OS0DYJlAbR7yA643yCXlM2lYskOCjoVApcFRNFlLs5sMuSGJvleb F0PNxMYamvEQUpQ6rQReO9W6bSerUay3qgFygP5hn+V8N/k99R2MvaxMSYIU7RWUymn3 tvTptvwop8wQeoW+wH/ecg/V5LDgoNCbo3rIevh8brUUDgNYPRoPSZ1/4i0Sqz+5lgGB nEtUeoS8BJ3HrokeR/oQIh0JwJo/a7UgDBtlgmN1u7NBtY/BIHa9Dhwv7i4l/cZfuP3r d/wc5I3YSCZ9VRsEyitaVRabqLfCFkaunQx5eW5t2+esamtAQLD7wGlIK51MlM7k3/js nQBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=VE5g7ClR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id o66-20020a634145000000b00565360714f0si3725828pga.902.2023.09.15.15.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 15:41:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=VE5g7ClR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 86D8380D755D; Fri, 15 Sep 2023 14:27:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235042AbjIOV0c (ORCPT + 99 others); Fri, 15 Sep 2023 17:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237728AbjIOV0P (ORCPT ); Fri, 15 Sep 2023 17:26:15 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 849DC101 for ; Fri, 15 Sep 2023 14:26:08 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2bfbd7d49e7so42093721fa.1 for ; Fri, 15 Sep 2023 14:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1694813166; x=1695417966; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yePpIdQ7WZGAqEgEwzbub2QYZTvPnhatZu9Hi1ymeRU=; b=VE5g7ClR/ct5me5mLRm/Qdgli8EsMioaKNBE4BPIcOpeIUSYtgiRD4IoZ9pq2EIkDV 5BQKSRh82Cnr4P1FSFK5DX2aU2Cmgme+32pcwfo/bE2xaQlsQZp3c6U+la3HsUvZuXva N0/uQdnNqVIC53U6F1NynDd4GPEsSk9kaV8qU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694813166; x=1695417966; 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=yePpIdQ7WZGAqEgEwzbub2QYZTvPnhatZu9Hi1ymeRU=; b=kQZaSg3D0/gLNNmnXt8cI/hV3d5qQGc8eO0yohgumKjd1zpXljqVh+QDOoLc7mAnSy KmCOHuMjAPjqhsOg/4EQjuCSt9ohqengQbkIBzMGZgZExoZ/GpYhGMvtpY4CM8LONsVn MjFaoWFnDvN8YX4wUox5xsVhBMW8aWMhHpM84LzDfxCvQs6wCaGKW8bz1gS7A/ST2tID aizv+PwYAKFxcx/N53WD2jB5B/9PM/GdQ0SAVmkxpw8iH5mKE0ZMnhV+EGWShZY0mj/o O81BAIfNuzj0nMBwxaRrOkMXolD/MBfsCyBdyy/UYmBAbBUGKR0833CB0z7TKKuruRWI rB3w== X-Gm-Message-State: AOJu0YwVcTBfqTPFBrSuW9yt63GOOBtk4rTi2Hruz1gXmQp3l3v8HBqf T0mkS7Le3MlA5bzeYhq8USSyPhuFez/9yjYnR/+ZfBAj X-Received: by 2002:a2e:a0cb:0:b0:2bc:b6b0:1c4d with SMTP id f11-20020a2ea0cb000000b002bcb6b01c4dmr2521123ljm.10.1694813166705; Fri, 15 Sep 2023 14:26:06 -0700 (PDT) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id z15-20020a1709060acf00b0098d2d219649sm2918391ejf.174.2023.09.15.14.26.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Sep 2023 14:26:05 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-52f9a45b4bdso3063130a12.3 for ; Fri, 15 Sep 2023 14:26:05 -0700 (PDT) X-Received: by 2002:aa7:d416:0:b0:525:7d81:71ee with SMTP id z22-20020aa7d416000000b005257d8171eemr2220876edq.15.1694813165215; Fri, 15 Sep 2023 14:26:05 -0700 (PDT) MIME-Version: 1.0 References: <07c32bf1-6c1a-49d9-b97d-f0ae4a2b42ab@p183> <20230915210851.GA23174@noisy.programming.kicks-ass.net> <20230915211815.GA34041@noisy.programming.kicks-ass.net> In-Reply-To: <20230915211815.GA34041@noisy.programming.kicks-ass.net> From: Linus Torvalds Date: Fri, 15 Sep 2023 14:25:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Buggy __free(kfree) usage pattern already in tree To: Peter Zijlstra Cc: Bartosz Golaszewski , Alexey Dobriyan , linux-kernel@vger.kernel.org, Linus Walleij , akpm@linux-foundation.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 14:27:02 -0700 (PDT) On Fri, 15 Sept 2023 at 14:18, Peter Zijlstra wrote: > > Hmm, perhaps I can do a class for it and write the thing like: .. crossed emails. Yes. Except I think a full-fledged class thing is overkill for a one-time use, and I think you really could just write it out as plain "this is the constructor, this is the cleanup". Yes, yes, that is obviously what our CLASS() thing *is*, but at least my personal mental model is that a "class" is for when you really export it to other uses. If you just have a one-off, you don't need the class abstraction to export to anybody else. You just do a one-off "alloc like this, free like this". Again, this I think is really just a "mental model" rather than any hard rule. Linus