Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp714296rwe; Fri, 14 Apr 2023 08:48:06 -0700 (PDT) X-Google-Smtp-Source: AKy350abqRjO0jkJmBTPONF3DgItUxnVVny6r4rmHfd0sf+CdVQqnzS6YYdY3ld9QbeCMjVDBt8F X-Received: by 2002:a05:6a00:2449:b0:628:1b3:d499 with SMTP id d9-20020a056a00244900b0062801b3d499mr8576318pfj.21.1681487286178; Fri, 14 Apr 2023 08:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681487286; cv=none; d=google.com; s=arc-20160816; b=yu+bpgjTgwSqvBJ7eWEDyERi21sRXfBvR39RxjB4kN2mXlJDDihgyFkwPhu3PSDnfd aP1hwd5IMg38C/sftuZTcYgNohOTt+uAkL2TSKu8kKaHWheT5/CZhJ1Pr7iijtPZ6MGA T8tU2fc6qjgT9q5OE4ZSm4/iZdygwvIgXCLNzQx5sNChebj/vVz8+yu9NAGikd95P3Ca J+nKP1kfFF0J8ipnA/Hyovn+nXrGJPMVCKzDD5LT/OMcYgpNwrwkvxYmoh2z1fqgqzPs 18mkEt4d5YXDI0SL0cehTZat3OKDI7nLYuNWTaD78tYh556j0wtnLI+/cRCTIE6qo24I EO6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=7gutJ4yAe/JkNa5xIKaFp+nwMYRP6dEdLjl9hZY/uZI=; b=pRyPaI/BFIg49UpLsFCFHc0klY6xEjhz+ASFHQW9WjoqwgNA1hjFVb07Z17+ixXLsn bvblYyCr+PRFIJ42/JD7YThTss1QYTQ/FpD+Esma7aaLl7gfqQB+l4dnvmTllVWhJ1YV zgzR0nFpfjhs0AAMYBQmbOlE0DGASUbeiLIjVN8nftB49ige8yKi/C5/htKddx9IRytZ jT3V+6Ef+ZwXXp6K/fUAv/G6yf1VNPpv1kZtUVnX1HTJtzju8XsHe16RNFAlRyDPfp4S tpsrBdcRSOel5TdqSnf0dVjqc8St5LzEerDTCBNAUPD7tAyixK+9cidMW+4UQx+vxhYk ZbWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=PvGDFGLr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a63d847000000b0050bfc20c788si5002340pgj.282.2023.04.14.08.47.48; Fri, 14 Apr 2023 08:48: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=@bytedance.com header.s=google header.b=PvGDFGLr; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229820AbjDNPpe (ORCPT + 99 others); Fri, 14 Apr 2023 11:45:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjDNPpd (ORCPT ); Fri, 14 Apr 2023 11:45:33 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5095C26BB for ; Fri, 14 Apr 2023 08:45:32 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id z11-20020a17090abd8b00b0024721c47ceaso5056701pjr.3 for ; Fri, 14 Apr 2023 08:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1681487132; x=1684079132; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=7gutJ4yAe/JkNa5xIKaFp+nwMYRP6dEdLjl9hZY/uZI=; b=PvGDFGLreO1q29h5tvBQs9H97oRCot38LOJh2IXEjgQ1nEd+yKU3UIVeo6ofc0d+kG FgA+wfySoF9yjy32yIJRizWd8XCsL4YQUznFpKGhUFi7H2AX7h0phxaynMRPwJ1G+G0n dycW07AIRpiZL/osBuPHuLRx/P/fqstRX6xwn9k/VC7zaAy2OCYOYW7LyUnTmHBhwill XOsGXVirvJdQaZvAPTlXlSTaLwgq2u2WL5qju5Mw/3cIFlCZaGdNZoR15DHQqDuK1kOc pmZGKVv7QSc1yL3ym+iRg54SnkL2RhSrOaTqJkEh5jvYJ9ofCnGltHz8WIlCte/CveuE WP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681487132; x=1684079132; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=7gutJ4yAe/JkNa5xIKaFp+nwMYRP6dEdLjl9hZY/uZI=; b=Jj3Kv7+7mPz0Nhm+AwCYteD3T5lzYAPtWvGkFMclbQC8NL9P0OX034NRkgxRc1p7BP p370gXN2LmzRlet99lu+cxn+CTlpaIJDERL9pdLncpB/18l1IJ0DPzHopJ9HTJNOyem1 gzLEmCLgC5dmU+mF+cVohExLWfgUbBEgUBJPHFsU0TOaB6dSF/sR0+XBVP4OCfVftsxq nB5BLeAUBC+UirAVsnMwxP2IjLPOQGlo9/bf+P0th6WI2tDrJA7Lm2gYm0Nb/JCUjzvS PIdLLoqcetZvkimOFaauI/mAlYeeBAvr+P62BAkx9b2YHOZtG6mS4k5Dayz+8Qx+i3zd o0fg== X-Gm-Message-State: AAQBX9eriahyswqJ0yVjHxqCDpPF4TJ9SHaNr/KsONFstuy3oPXjUl7f 93Z2WHuGx5et0QQZd7FYIUQmDw== X-Received: by 2002:a17:902:e801:b0:1a6:4714:5cb2 with SMTP id u1-20020a170902e80100b001a647145cb2mr4074836plg.2.1681487131808; Fri, 14 Apr 2023 08:45:31 -0700 (PDT) Received: from [10.255.185.5] ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id g21-20020a170902869500b001a5260a6e6csm3201794plo.206.2023.04.14.08.45.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Apr 2023 08:45:31 -0700 (PDT) Message-ID: Date: Fri, 14 Apr 2023 23:45:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: Re: [PATCH V5 2/5] cachefiles: extract ondemand info field from cachefiles_object To: David Howells Cc: linux-cachefs@redhat.com, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, jefflexu@linux.alibaba.com, hsiangkao@linux.alibaba.com, yinxin.x@bytedance.com, zhujia.zj@bytedance.com References: <20230329140155.53272-3-zhujia.zj@bytedance.com> <20230329140155.53272-1-zhujia.zj@bytedance.com> <1250339.1681480291@warthog.procyon.org.uk> From: Jia Zhu In-Reply-To: <1250339.1681480291@warthog.procyon.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 在 2023/4/14 21:51, David Howells 写道: > Jia Zhu wrote: > >> #define CACHEFILES_OBJECT_STATE_FUNCS(_state, _STATE) \ >> static inline bool \ >> cachefiles_ondemand_object_is_##_state(const struct cachefiles_object *object) \ >> { \ >> - return object->state == CACHEFILES_ONDEMAND_OBJSTATE_##_STATE; \ >> + return object->ondemand->state == CACHEFILES_ONDEMAND_OBJSTATE_##_STATE; \ >> } \ >> \ >> static inline void \ >> cachefiles_ondemand_set_object_##_state(struct cachefiles_object *object) \ >> { \ >> - object->state = CACHEFILES_ONDEMAND_OBJSTATE_##_STATE; \ >> + object->ondemand->state = CACHEFILES_ONDEMAND_OBJSTATE_##_STATE; \ >> } > > I wonder if those need barriers - smp_load_acquire() and smp_store_release(). > > David There are three object states: OPEN, CLOSE, REOPENING. Here is no logic in the code such like: A has to watching and waiting for B's status change. And so far I haven't constructed a scenario requires barrier pairs. Thus I didn't add barriers here. Jia >