Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3504986rwd; Mon, 22 May 2023 15:08:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Tg0hNZ0QZqx0I5qmxihI6M1FvgcCMqpPvenvcWHRgoeUBnZWayaEhn+wH2Mt+w/Q1z5uF X-Received: by 2002:a05:6a00:b49:b0:643:9e7c:3829 with SMTP id p9-20020a056a000b4900b006439e7c3829mr15971971pfo.12.1684793309874; Mon, 22 May 2023 15:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684793309; cv=none; d=google.com; s=arc-20160816; b=o+vGRh0RhxnpR2rmyIvSwjjYBUi9aaGDVwo/+Vpyb50ZUIlWWe2Scl7TmEhRHJmNAu 42kjHzSKR3v6P7fiWKnLJ+asXUnVJlwnP46CsyTvzxY2N5HBMLjXOBFpgryKMMAd5VQ9 vieXOkmRK3mvSyHNh+bEZITjjIjg1fdAsILDyApTIKHQmle+85Oljvfo+GsGXCDu4YSu x89Hc4JWFZNyCLvmvqImyYfIvLYNsdrLATiZ7xz/gfQNZ4xJ5IWemTeSe5Ngq8H2SBqG ZUDUQMaY1ec74W8QD5nRIL0TdRFi/8v5cLPyDTN0gCMySvjz2AcFZlBCJLYilcZhvWhz lZeg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=5QAvJ/iGAbjIjEqSRGRTpOEUvtc5je7nuG2/VHxeajg=; b=txoi2crFx9tjQgWM31hugCIOmP2B86d7KXp5BtacZOGW/6YV/k3tsu7JqW+P4RW9bz xW+7sOCjiA5dX7OJTTRrL9VMTRnBfYSMkgHX34bAqqWOavWa6fHeqsVYp9B57evPB7MC llGtyahLa/RpXKzlYt5QvyMQxPmPcrioOQ+Dol00A1islSo7Hjj/+GuMFWFZO5tylFo0 pmHcRfrQfB9QgDQkyWPh12w73xspk3fcPBIYCVirKSDQiupdwnR5ejLiwKb5IrJ0gcsx s8cWI1ouKKabV6XiOmotSZFk+bOr6X8fAHtE8ndjN+koTBFcLQz7XUf5O9+fdsCtUPPC 46bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="GMQNOnt/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020aa79529000000b0064678cefdd5si5441614pfp.223.2023.05.22.15.08.14; Mon, 22 May 2023 15:08:29 -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.dev header.s=key1 header.b="GMQNOnt/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234067AbjEVVwY (ORCPT + 99 others); Mon, 22 May 2023 17:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbjEVVwX (ORCPT ); Mon, 22 May 2023 17:52:23 -0400 Received: from out-16.mta0.migadu.com (out-16.mta0.migadu.com [91.218.175.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11F9FF4 for ; Mon, 22 May 2023 14:52:21 -0700 (PDT) Date: Mon, 22 May 2023 17:52:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684792339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5QAvJ/iGAbjIjEqSRGRTpOEUvtc5je7nuG2/VHxeajg=; b=GMQNOnt/tNnvMQcLA0Upi3kPKexsfbDfLa5CVBPx1OMBMtpCahn5sC97sd7FdGoTJ87WEF iCDNXt/YNJyDtPAEaruyIEXua/Xh2eUDec5lCt9MGhO65WR6UFFUC6oA9//0Rrv5bkCX9z yUdE9lxX6Yle+bfRaNMnPPeJyzZmVao= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Brian Foster , Dave Chinner Subject: Re: [PATCH v2] locking: SIX locks (shared/intent/exclusive) Message-ID: References: <20230522171314.1953699-1-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, May 22, 2023 at 01:53:36PM -0700, Linus Torvalds wrote: > On Mon, May 22, 2023 at 1:13 PM Kent Overstreet > wrote: > > > > Uh, I think you're wrong on this one - structs with designated > > initializers have unspecified fields initialized to 0 > > That's definitely true for unspecified fields. > > But there *are* no fields. Only padding. > > That said, gcc does seem to always initialize the whole thing. We even > rely on it when it comes to structures, but I'm not sure it's strictly > standardized - and I'm particularly not sure about unions. > > But there are counter-examples, like this: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104607 > > so maybe even structures aren't always initialized fully? Yeah, I have to concede - if we can't rely on struct padding being initialized we can't rely on union padding either. > No, Because of *alignment* issues. > > An u32 is 4-byte aligned. But "set_bit()" requires "long" alignmnent,. Ah - right...