Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp670864iob; Wed, 4 May 2022 05:47:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp00LA0l2UhlKpxvJX4ia9Iujoyby5KQ/RTJWfW3ndHf4nxYbYT1zdxDlNwaenU9Q/bkZm X-Received: by 2002:a17:906:9b93:b0:6da:6388:dc57 with SMTP id dd19-20020a1709069b9300b006da6388dc57mr19567158ejc.338.1651668434221; Wed, 04 May 2022 05:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651668434; cv=none; d=google.com; s=arc-20160816; b=vq6RR8YC0Z1PFGoBNMuKikRauAQimmfezcthjg512JR5Pyroil1FOy/LbMIkzqKqUG 4eS9yHtCDW4WAm6u7tl+yjUBYESZSwVNljR6AxU/o6WhAz1Eow6MUOHhX0GQZtmI+H8h bgF5UpoAIzjvVEJfgSQG3veoIOWZ8hZ4TS++rTQFndL9p+r4KhsWaafuKtt4A8bggC6W 5HQAsJwlaJvmIwqLP5x38kr/1Sm01sY2ME9eUEJWnxdp+MeUSMZ1a85FAPWjOgB/0UAK /dmfN3esRla0RbOxJm6DH7LFTSrq2BCD5rm/0l6gjagNt+N2MCjUseOhvai5BbIgSH1j DyDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-filter; bh=EyFNcCLwDWe0KckQJFtUU7024vDpmi+//CTEsimyINA=; b=bUNBPtA5pDFJ4P/vD0ufjR3WSspdXtSkwJm392yk9VMxfokMp/Ybdxtoc4EosofkYl 3MpuNTl2uVRVH1jmHipFbVO2rDpm0owBDmzwSc4yyLEo4l5dg85NStyvc2BHO7IqkkCf r3x221p6dRrSuW+8joetUtIxFG3UEcWFf8nlOzeuwDuy2D2vzrMc6w05sXokYnw1ioSk 0/108WLSokW4wplBnmt5AbVr5Qam/KBgxy59V0l+QfeFPqZvXci0gO6fNZ73Gq0dXHQq GJ00TiW47ra5DUffm3cdf9uPgCAyl9VqfgDSHEHQzvKchm/twWY6DilAXoEb1Yn/Woh+ RqXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a056402350f00b00423f53f637fsi18279939edd.32.2022.05.04.05.46.42; Wed, 04 May 2022 05:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235140AbiEDL1Y (ORCPT + 99 others); Wed, 4 May 2022 07:27:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234974AbiEDL1X (ORCPT ); Wed, 4 May 2022 07:27:23 -0400 Received: from mxout04.lancloud.ru (mxout04.lancloud.ru [45.84.86.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E63A5140BE; Wed, 4 May 2022 04:23:44 -0700 (PDT) Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru 2E7B02130938 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH RFC v6 16/21] dept: Distinguish each work from another To: Byungchul Park , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <42.hyeyoo@gmail.com> References: <1651652269-15342-1-git-send-email-byungchul.park@lge.com> <1651652269-15342-17-git-send-email-byungchul.park@lge.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <24e4d6db-9dc9-f113-f655-9af3a51723d4@omp.ru> Date: Wed, 4 May 2022 14:23:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1651652269-15342-17-git-send-email-byungchul.park@lge.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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-ext4@vger.kernel.org Hello! On 5/4/22 11:17 AM, Byungchul Park wrote: > Workqueue already provides concurrency control. By that, any wait in a > work doesn't prevents events in other works with the control enabled. > Thus, each work would better be considered a different context. > > So let Dept assign a different context id to each work. > > Signed-off-by: Byungchul Park [...] > diff --git a/kernel/dependency/dept.c b/kernel/dependency/dept.c > index 18e5951..6707313 100644 > --- a/kernel/dependency/dept.c > +++ b/kernel/dependency/dept.c > @@ -1844,6 +1844,16 @@ void dept_enirq_transition(unsigned long ip) > dept_exit(flags); > } > > +/* > + * Assign a different context id to each work. > + */ > +void dept_work_enter(void) > +{ > + struct dept_task *dt = dept_task(); > + > + dt->cxt_id[DEPT_CXT_PROCESS] += (1UL << DEPT_CXTS_NR); Parens around << unnecessary... [...] MBR, Sergey