[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/sched: remove wrong assertions in csched2_free_pdata()


  • To: Juergen Gross <JGross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dario Faggioli <dfaggioli@xxxxxxxx>
  • Date: Tue, 12 Nov 2019 18:45:04 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n9dPRfEFqMG5ezRax52fPy+0JDPyj9yLKluq+oc6cBk=; b=g08Nxamt7yrHAtQMy08XIhjf3CSYsokKQcBvZP8AlvDlhCsfCVFb9PA5NkIx+WRerDlk3xaCvvfSP1JJwJbuc84EwTUXo9lnZRWN8Nz39eUBLB8AbySlC/WqU5jagkG7cuciimyS9DwpeI9V8Ha5gFD1EGFIGNplf1jZMCKiIpTVYd7IPUQYwV08dvpMJRZ/rovZovIgcfYaj+Ljn4xRfPFu3veDJY/i4Kvmd9/injbol7FYElO7JJKKs5Sc4aT5nKBTNhaGtZ2g/7m48ZuJPSmX9uVAc5/Lw4UziFvcPzDVkABU/CVC1gjRyW35UwRiuaSoxmvFsqBUamZBDL3tlA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QQAikhnTnJJlfwCqQWXg8EWCNfd3hnZeHAI5SKtz22McmszeCsCaTCng9hO+xjaQnN/Ac+Ipo0Kut+7qEWyJGx+m2YxkbfhUpRz3oZEDpCoqcZ6IiUWI/bQh9puiGb24lLwn/DgtW+LVQiBPJc/AqSRRTJ5oVWjiubPTiJeKNqmt2BvYHE5XEHveogdcAGr6/Lj8H48xjUtNwv9HA1/pFlCUT7Uv5SUYJZZfKsvkxUQXrSFw2UJbJWfYV9EYwS8GVa1ZQ9JFr+YPoCb1Kyob6XZ2fc8ZJEOZoI32q/DMi8awT9jS8njuTqzCKlkdliBfyg/xoH8g4CWdaonjF2xOhQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=dfaggioli@xxxxxxxx;
  • Cc: "george.dunlap@xxxxxxxxxxxxx" <george.dunlap@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 12 Nov 2019 18:46:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVlgeY8Z6/EjFwCU6F3Z36wZlID6eH5oWA
  • Thread-topic: [Xen-devel] [PATCH] xen/sched: remove wrong assertions in csched2_free_pdata()

On Fri, 2019-11-08 at 08:38 +0100, Juergen Gross wrote:
> The assertions in csched2_free_pdata() are wrong as in case it is
> called by schedule_cpu_add() after a failure of sched_alloc_udata()
> the init pdata function won't have been called.
> 
Sorry, maybe too much time has passed since when I wrote this code, and
I'm rusty, but the comment says:

 "we want to be sure that either init_pdata has never been called, or 
  deinit_pdata has been called already"

So, the case of init_pdata not having been called is considered.

And yet, you are saying it is wrong because:

 "in case it is called [..] after a failure of sched_alloc_udata() the 
  init pdata function won't have been called"

But, as just said, init_pdata not having been called was one of the
possibilities... wasn't it?

Or am I misunderstanding the meaning of the sentence above?

Don't get me wrong, I never particularly loved these ASSERT()s and I'd
be more than fine seeing them go... :-)

Have you seen them triggering inappropriately, either before or after
the core-scheduling series (and either with core-scheduling on or off)?

Regards

(leaving the patch in context on purpose, in case it's useful)

> ---
>  xen/common/sched_credit2.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
> index af58ee161d..a995ff838f 100644
> --- a/xen/common/sched_credit2.c
> +++ b/xen/common/sched_credit2.c
> @@ -3914,10 +3914,6 @@ csched2_deinit_pdata(const struct scheduler
> *ops, void *pcpu, int cpu)
>  
>      write_lock_irqsave(&prv->lock, flags);
>  
> -    /*
> -     * alloc_pdata is not implemented, so pcpu must be NULL. On the
> other
> -     * hand, init_pdata must have been called for this pCPU.
> -     */
>      /*
>       * Scheduler specific data for this pCPU must still be there and
> and be
>       * valid. In fact, if we are here:
> @@ -3969,18 +3965,6 @@ csched2_deinit_pdata(const struct scheduler
> *ops, void *pcpu, int cpu)
>  static void
>  csched2_free_pdata(const struct scheduler *ops, void *pcpu, int cpu)
>  {
> -    struct csched2_pcpu *spc = pcpu;
> -
> -    /*
> -     * pcpu either points to a valid struct csched2_pcpu, or is NULL
> (if
> -     * CPU bringup failed, and we're beeing called from
> CPU_UP_CANCELLED).
> -     * xfree() does not really mind, but we want to be sure that
> either
> -     * init_pdata has never been called, or deinit_pdata has been
> called
> -     * already.
> -     */
> -    ASSERT(!pcpu || spc->runq_id == -1);
> -    ASSERT(!cpumask_test_cpu(cpu, &csched2_priv(ops)->initialized));
> -
>      xfree(pcpu);
>  }
>  
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.