Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5513335ioo; Wed, 1 Jun 2022 07:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrHj52BW3Tz3vOBneEIXEc378QZvAfNa7jJPAZZUkOQK7XHJY/Jb+wZpwnRKPPjoiGyc02 X-Received: by 2002:a17:903:2d0:b0:14d:8a8d:cb1 with SMTP id s16-20020a17090302d000b0014d8a8d0cb1mr66986plk.50.1654092426412; Wed, 01 Jun 2022 07:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654092426; cv=none; d=google.com; s=arc-20160816; b=BNz/55k1H09n1vI5EHGWZbIlyMVjH7zWWeIAgxXKQVp/zrBEsznRH8Xr0QbOPmXgG6 RZ33xshtJj1UH8HZ9zXQq7pIlGyPpfvupid5+B+pRlCAjMGndneDTC7vsyuoYkbSUAJP JQglBUtX8K0euP3DORBNyAUZrYcdDK9bUiGQE8fZ9VPAN4htJdtk9Khcm/MY4alPRpOO 5K+HLruXHL6z2WFM22T6K6bbs+Sg+cCdNNfvhh2EGNR+KZoP8GX0oR7menobZR82cRE5 q9SPcBiXlkOSKhroxSSnw7lbSUeZ/+zrbVMxYCC2Z3ITkKOYRnetmYg9sFrxGA5oEyYe kHsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:in-reply-to :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=nStA9lqh6i5uOfeF+xwtlFCvRjzsWn5OqHELFm3vFb4=; b=KVViIc+4p4k8vNdmmCNeKEyOw4xECQVN5VRybbOC6fEFAvc0KkuohNREPqImz2vrro c81kLWNoHyau0fAHWSK9XKj54EU2ACijz8Az3fFeM2f/wlrbz9ra3nY5rL9vDgptUutC A203KmghDCwCV8imDrvPHSI5IlWHQlo4/piqb9Jyyi+Nknes7HJOh8wquIApUcULO7u/ GAONdujHfFY/QSjrXqZY14vkzysLQULj5Mbh7Lk3gU6chY0qn0p5b7thpaKlHi4ae73c JMuo3ZmXCJPp/kWj46iSKRnaqoZPYkOxLN65fwIStaMHNi/YjQMdb81D1EMnFKnIIcVb uFkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=qbYhFDmD; 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=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a635a02000000b003fc4001a309si2585597pgb.215.2022.06.01.07.06.51; Wed, 01 Jun 2022 07:07:06 -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=@deltatee.com header.s=20200525 header.b=qbYhFDmD; 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=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242486AbiE3P6U (ORCPT + 99 others); Mon, 30 May 2022 11:58:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231980AbiE3P6G (ORCPT ); Mon, 30 May 2022 11:58:06 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CAA99822; Mon, 30 May 2022 08:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:In-Reply-To:From:References:Cc:To: MIME-Version:Date:Message-ID:content-disposition; bh=nStA9lqh6i5uOfeF+xwtlFCvRjzsWn5OqHELFm3vFb4=; b=qbYhFDmDAJvgqI4LQL2tYR1y/k MYRLNo9sNH7/EiAVHFxRRz5EseRqS0pmDphXDMkflWot8X5kYg7hN5N3PiPbsrJVPcW/C2F5KF4w7 hSD+ETefUAmP6Ri8JloTk2rVxcrKW4QbrX4rMx+qSu/g7jWEaTGVXlQZqH8Xx4mJZZCgciX+s60Cw wrpvuPD2F9oyhQu9DWE7FfUETYhhFVEAP8+08Nm8hNW4bmyOISIN1E00TK2CQtrr2WUFlSNVNcwZX TTpKyQTIPBklBk34bdrFzkXkLTFMx3dT6Hx7qa4ajU/DR2yWCKAUZwASonrAodZNWztqbyL9baqJt r8t9tJbA==; Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nvhd9-00Bjxp-0q; Mon, 30 May 2022 09:48:31 -0600 Message-ID: Date: Mon, 30 May 2022 09:48:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-CA To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu , Donald Buczek , Guoqing Jiang , Xiao Ni , Stephen Bates , Martin Oliveira , David Sloan References: <20220526163604.32736-1-logang@deltatee.com> <20220526163604.32736-13-logang@deltatee.com> From: Logan Gunthorpe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: hch@infradead.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH v2 12/17] md/raid5-cache: Move struct r5l_log definition to raid5-log.h X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-05-29 23:59, Christoph Hellwig wrote: > On Thu, May 26, 2022 at 10:35:59AM -0600, Logan Gunthorpe wrote: >> Move struct r5l_log definition to raid5-log.h. While this reduces >> encapsulation, it is necessary for the definition of r5l_log to be >> public so that rcu_access_pointer() can be used on conf-log in the >> next patch. >> >> rcu_access_pointer(p) doesn't technically dereference the log pointer >> however, it does use typeof(*p) and some older GCC versions (anything >> earlier than gcc-10) will wrongly try to dereference the structure: >> >> include/linux/rcupdate.h:384:9: error: dereferencing pointer to >> incomplete type ‘struct r5l_log’ >> >> typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \ >> ^ >> >> include/linux/rcupdate.h:495:31: note: in expansion of >> macro ‘__rcu_access_pointer’ >> >> #define rcu_access_pointer(p) __rcu_access_pointer((p), >> __UNIQUE_ID(rcu), __rcu) >> >> To prevent this, simply provide the definition where >> rcu_access_pointer() may be used. > > What about just moving any code that does the rcu_access_pointer on > conf->log to raid5-cache.c and doing an out of line call for it > instead? I guess we could do that. All the inline functions in raid5-log.h are there to choose between the r5l or the ppl implementaiton. So it that would mean the r5l implementation would probably be inlined and ppl would be doing a second out of line call. Not sure if that matters, but it seems a little odd. Logan