From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6AEAC282DD for ; Fri, 10 Jan 2020 19:13:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 91A282051A for ; Fri, 10 Jan 2020 19:13:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91A282051A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3DA3E8E0006; Fri, 10 Jan 2020 14:13:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 38A148E0005; Fri, 10 Jan 2020 14:13:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A0B18E0006; Fri, 10 Jan 2020 14:13:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1764C8E0005 for ; Fri, 10 Jan 2020 14:13:39 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id D08FD248E for ; Fri, 10 Jan 2020 19:13:38 +0000 (UTC) X-FDA: 76362673716.29.berry25_59dd2f5131903 X-HE-Tag: berry25_59dd2f5131903 X-Filterd-Recvd-Size: 3564 Received: from Galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jan 2020 19:13:37 +0000 (UTC) Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ipzif-0003It-LL; Fri, 10 Jan 2020 20:13:17 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 067A6105BDB; Fri, 10 Jan 2020 20:13:16 +0100 (CET) From: Thomas Gleixner To: Anchal Agarwal Cc: mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, kamatam@amazon.com, sstabellini@kernel.org, konrad.wilk@oracle.co, roger.pau@citrix.com, axboe@kernel.dk, davem@davemloft.net, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, peterz@infradead.org, eduval@amazon.com, sblbir@amazon.com, xen-devel@lists.xenproject.org, vkuznets@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, fllinden@amazon.com, anchalag@amazon.com Subject: Re: [RFC PATCH V2 09/11] xen: Clear IRQD_IRQ_STARTED flag during shutdown PIRQs In-Reply-To: <20200109234050.GA26381@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> Date: Fri, 10 Jan 2020 20:13:16 +0100 Message-ID: <87zhevrupf.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Anchal, Anchal Agarwal writes: > On Thu, Jan 09, 2020 at 01:07:27PM +0100, Thomas Gleixner wrote: >> Anchal Agarwal writes: >> So either you can handle it purely on the XEN side without touching any >> core state or you need to come up with some way of letting the core code >> know that it should invoke shutdown instead of disable. >> >> Something like the completely untested patch below. > > Understandable. Really appreciate the patch suggestion below and i will test it > for sure and see if things can be fixed properly in irq core if thats the only > option. In the meanwhile, I tried to fix it on xen side unless it gives you the > same feeling as above? MSI-x are just fine, just ioapic ones don't get any event > channel asssigned hence enable_dynirq does nothing. Those needs to be restarted. > > diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c > index 1bb0b522d004..2ed152f35816 100644 > --- a/drivers/xen/events/events_base.c > +++ b/drivers/xen/events/events_base.c > @@ -575,6 +575,11 @@ static void shutdown_pirq(struct irq_data *data) > > static void enable_pirq(struct irq_data *data) > { > +/*ioapic interrupts don't get event channel assigned > + * after being explicitly shutdown during guest > + * hibernation. They need to be restarted*/ > + if(!evtchn_from_irq(data->irq)) > + startup_pirq(data); > enable_dynirq(data); > } Interesting patch format :) Doing the shutdown from syscore_ops and the startup conditionally in a totaly unrelated function is not really intuitive. So either you do it symmetrically in XEN via syscore_ops callbacks or you let the irq core code help you out with the patch I provided Thanks, tglx