Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp559504lqp; Fri, 5 Apr 2024 01:54:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/TbS3WAulo08DjleOPx+fol4ZRrsXJff97rvyg+r3ZzXmkevhoJvWQlTDQ598cwJEm5WyC3C33lNz4SsY3fdiNCe8QXXu/JRWRErfQw== X-Google-Smtp-Source: AGHT+IEtih/7bh1YuhahxGLSn8nxOq7YhlaD0h14lMjYuA8R4LfcBqQFIS8EZZuPeuXS443alAbx X-Received: by 2002:a17:903:2001:b0:1e0:62bc:68d4 with SMTP id s1-20020a170903200100b001e062bc68d4mr771704pla.14.1712307292107; Fri, 05 Apr 2024 01:54:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712307292; cv=pass; d=google.com; s=arc-20160816; b=oq/sHiaoXkwacyfB5BfLm8yKL3CTDUd1xrCjwG3xXjREbieUvZNnGsOWBXZsYwC+7R NODZy4Bm3231cy3e9KZi2Y4I0KD9vpYHFXYQ5UrXWlvozamzCsG1QFe9mz07IXQ0f/vL +5SHLAGv82Y/SxVGs+i8kTjhvVWNwTjwlvaGMsYKr+cSXjpIAvvJlUIKXpUksrREd0LK pOthoyikqBOlS3IOb8EJNSxRP4AxIVp2JdRe50IWOUQR5C1ldcrr3H2TPG9Hv7W445N8 ypWP018LEQqcU4FDBYcVv/KlUmQgLIR53MSSQYc2injOMRUgeOVURg9nZUkiLdKx76F5 5l4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=U0n4Wf++FQKQw0aWu2Eok5zHZiTJsrQPIZ7GVke1MO8=; fh=j9fR8Jg+vx6UT6nsPTrBm5z1wED8t1CiSxHmGOM3+PA=; b=QThu3IsfkKiDeI372A3SRhdMJvey6vJT6CCj5UvfSVNnXYpvXWOPLXsTZ0sT/qWl+w Yzq9ghJ7u7MeIoKIVsOld+EQOkDbzGbH4ffgSwiJZXStig2B0JttsNNXgNxcyxaqs5+P vylq9W7J1MuCCrf1Ri9W0byMfOH8VSQf63jmwEQ2zL0A28Q4RStLOlDYDWIvy2KKqqOV HHAH2MTsOx/m+R7W1aqcIHPLAVvMUdwLCjBDhqSH2F589koVR4RmJ2+eynzFPfyp7mVD ZFXu5BCrFgOe8BXNubqy/bfLlVscRrPjyz0yZDt87NdUCekg67ce8h1cRKNPhHU0JSxt 0NJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dNpmk22D; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-132686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k18-20020a170902c41200b001e0e85a2dabsi1037290plk.290.2024.04.05.01.54.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 01:54:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dNpmk22D; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-132686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1CCDF284658 for ; Fri, 5 Apr 2024 08:54:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0333915FA79; Fri, 5 Apr 2024 08:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dNpmk22D" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 350FC15F338 for ; Fri, 5 Apr 2024 08:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307248; cv=none; b=m2co4QUgKSPLuOOJ38ptxsrebIm4qA4WKKa3ORhRtMJMuCyR3QKRZeNwbX4gHXDj1ww8kqraS3vQH616we9vtL0Eo+sKfebeBZyo76OadSe9vbkOVi2H4xCyNFJPo6S0hlZmU6gbCjobtMDadmd0bSoinpmy5PH+qKDt6r/Dhv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712307248; c=relaxed/simple; bh=6B4qat+yFPdqzb0wEQ2YwmgI6BotASwtMTiHOWlr/PU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Tb+yFb+zpaKPbPsb8nKcjXo9e0zTT77Tn6xqJAN3EzNdET0P5k6pdXBZi4aImjUxT75UmVXQ80TVbVwJOGYB5Q5x4fHE4PdAD7yDnG9UDzGga2mL7hfODZHPHFc79KOKEpd98LmeA9auZm5qYSDNnaM8RLDXtN5Q4Tf1hrjOVeY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dNpmk22D; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712307245; 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=U0n4Wf++FQKQw0aWu2Eok5zHZiTJsrQPIZ7GVke1MO8=; b=dNpmk22DmZsBXvofHDgtJfVQ8+fwXG5kqzpw/4hX02AL9GrY3GBRSnvcVeJNy1K86v/gXO hS6XMIE6rcv58SKhvDtWrJcJT0gu+JI36ZUqqMGrHs0rwZy/qe670vvt16Uv4wUkdhSKse zsqbRXgm7w9lNodW09lAO780IL5GQ+E= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-AbbBmMbtNi6KAO1YLju_AA-1; Fri, 05 Apr 2024 04:54:03 -0400 X-MC-Unique: AbbBmMbtNi6KAO1YLju_AA-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a450265c7b6so95853366b.0 for ; Fri, 05 Apr 2024 01:54:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712307243; x=1712912043; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U0n4Wf++FQKQw0aWu2Eok5zHZiTJsrQPIZ7GVke1MO8=; b=p8y2DM0zOuQzs1Z3CC2F3iszqBnomuG7LhOWVqBTelV51xcad1jkEKhpkdI44svgiS aIvrftRp/NCTA0PZwHOxJQkh+6hMpLjz9vBFbjTs8kf+AMYbV1Wu3bm1fSDkx6hzv5lb ME8uzvXf1Adisg9/IGUy6MbkJBBYaS3W9BLBerBIdufvTgTFbWkYqDOXHX6z7jgsUfsi zeV29O1xq9qERQiKQQVeqWAF36+ALY8uj+LVMVdFNrq5YJuaH8KYwGF4sqXycvOI+OWa tTfvEaZdjKrVcpecXU3Tp583x+GIJsNtIzDxPseUevzUU8SD5W7FUZvxoqZPePjP1xg4 SBgA== X-Forwarded-Encrypted: i=1; AJvYcCUSzS5sXeQuBEmLMffF7cJRA0Ezc7t2A78UvN9aHh5kUBjBYy6orK4WX9+od9MptxuXPudpDOdYQ4Poy+Xat26M/yTn4KQBkXsKgTBC X-Gm-Message-State: AOJu0YwqE1uq0I9/4Obujr1cu129L55iVVkot3dZoqK62qpG1raMoSjw sh2T5A9d0VPvj9bHmAHE9eDTDA83m2kPreZS26FGsIZBAi58WOG1C1LLeXRRrtoNvxgX/e1MUtt tzPZzs6n3NtwbX0BqSMxhjvyZuVEFWsuQUjWXsndSfZY2OBH3jszVxwY34puiOQ== X-Received: by 2002:a17:906:b755:b0:a4e:68bc:a46e with SMTP id fx21-20020a170906b75500b00a4e68bca46emr539257ejb.43.1712307242759; Fri, 05 Apr 2024 01:54:02 -0700 (PDT) X-Received: by 2002:a17:906:b755:b0:a4e:68bc:a46e with SMTP id fx21-20020a170906b75500b00a4e68bca46emr539233ejb.43.1712307242428; Fri, 05 Apr 2024 01:54:02 -0700 (PDT) Received: from [192.168.0.182] (host-87-2-128-150.retail.telecomitalia.it. [87.2.128.150]) by smtp.gmail.com with ESMTPSA id z12-20020a17090655cc00b00a42f6d17123sm594252ejp.46.2024.04.05.01.54.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Apr 2024 01:54:01 -0700 (PDT) Message-ID: <51540780-580f-47ff-ae0a-7d335c0702f7@redhat.com> Date: Fri, 5 Apr 2024 10:54:00 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 11/15] sched/deadline: Mark DL server as unthrottled before enqueue Content-Language: en-US, pt-BR, it-IT To: "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider Cc: Suleiman Souhlal , Youssef Esmat , David Vernet , Thomas Gleixner , "Paul E . McKenney" , joseph.salisbury@canonical.com, Luca Abeni , Tommaso Cucinotta , Vineeth Pillai , Shuah Khan , Phil Auld References: <20240313012451.1693807-1-joel@joelfernandes.org> <20240313012451.1693807-12-joel@joelfernandes.org> From: Daniel Bristot de Oliveira In-Reply-To: <20240313012451.1693807-12-joel@joelfernandes.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/13/24 02:24, Joel Fernandes (Google) wrote: > The DL server may not have had its timer started if start_dl_timer() > returns 0 (say the zero-laxity time has already passed). In such cases, > mark the DL task which is about to be enqueued as not throttled and > cancel any previous timers, then do the enqueue. > > This fixes the following crash: > > [ 9.263331] kernel BUG at kernel/sched/deadline.c:1765! > [ 9.282382] Call Trace: > [ 9.282767] > [ 9.283086] ? __die_body+0x62/0xb0 > [ 9.283602] ? die+0x9b/0xc0 > [ 9.284036] ? do_trap+0xa3/0x170 > [ 9.284528] ? enqueue_dl_entity+0x45e/0x460 > [ 9.285158] ? enqueue_dl_entity+0x45e/0x460 > [ 9.285791] ? handle_invalid_op+0x65/0x80 > [ 9.286392] ? enqueue_dl_entity+0x45e/0x460 > [ 9.287021] ? exc_invalid_op+0x2f/0x40 > [ 9.287585] ? asm_exc_invalid_op+0x16/0x20 > [ 9.288200] ? find_later_rq+0x120/0x120 > [ 9.288775] ? fair_server_init+0x40/0x40 > [ 9.289364] ? enqueue_dl_entity+0x45e/0x460 > [ 9.289989] ? find_later_rq+0x120/0x120 > [ 9.290564] dl_task_timer+0x1d7/0x2f0 > [ 9.291120] ? find_later_rq+0x120/0x120 > [ 9.291695] __run_hrtimer+0x73/0x1b0 > [ 9.292238] hrtimer_interrupt+0x216/0x2c0 > [ 9.292841] __sysvec_apic_timer_interrupt+0x53/0x140 > [ 9.293581] sysvec_apic_timer_interrupt+0x2d/0x80 > [ 9.294285] asm_sysvec_apic_timer_interrupt+0x16/0x20 > > The crash can easily be reproduced by adding a 100ms delay as follows: > > +int delay_inject_count; > + > static void > enqueue_dl_entity(struct sched_dl_entity *dl_se, int flags) > { > @@ -1827,6 +1830,12 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se, int flags) > setup_new_dl_entity(dl_se); > } > > + // 100ms delay every 20 enqueues. > + if (delay_inject_count++ > 20) { > + mdelay(100); > + delay_inject_count = 0; > + } > + > /* > * If we are still throttled, eg. we got replenished but are a > * zero-laxity task and still got to wait, don't enqueue. Makes sense, I am adding this in the defer patch v6 as it is a fix for it... -- Daniel