Linux CXL
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	"Ira Weiny" <ira.weiny@intel.com>
Subject: RE: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held
Date: Tue, 20 Feb 2024 20:59:12 -0800	[thread overview]
Message-ID: <65d5832090c5b_1ada2029473@iweiny-mobl.notmuch> (raw)
In-Reply-To: <65d111eb87115_6c745294ac@dwillia2-xfh.jf.intel.com.notmuch>

Dan Williams wrote:
> Ira Weiny wrote:

[snip]

> >  
> > -	guard(rwsem_read)(&cxl_cper_rw_sem);
> > -	if (cper_callback)
> > -		cper_callback(event_type, rec);
> 
> Given a work function can be set atomically there is no need to create /
> manage a registration lock. Set a 'struct work' instance to a CXL
> provided routine on cxl_pci module load and restore it to a nop function
> + cancel_work_sync() on cxl_pci module exit.

Ok I'll look into this.

> 
> > +	wi = kmalloc(sizeof(*wi), GFP_ATOMIC);
> 
> The system is already under distress trying to report an error it should
> not dip into emergency memory reserves to report errors. Use a kfifo()
> similar to how memory_failure_queue() avoids memory allocation in the
> error reporting path.

I have a question on ghes_proc() [ghes_do_proc()].  Can they be called by
2 threads at the same time?  It seems like there could be multiple
platform devices which end up queueing into the single kfifo.  So either
there needs to be a kfifo per device or synchronization with multiple
writers.

Ira

  reply	other threads:[~2024-02-21  4:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 22:15 [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held Ira Weiny
2024-02-14 12:11 ` Jonathan Cameron
2024-02-14 15:23   ` Steven Rostedt
2024-02-14 18:12     ` Jonathan Cameron
2024-02-14 21:22       ` Ira Weiny
2024-02-14 22:19       ` Ira Weiny
2024-02-14 22:33         ` Steven Rostedt
2024-02-15  9:25           ` Jonathan Cameron
2024-02-15 17:39             ` Ira Weiny
2024-02-17  1:02               ` Dan Williams
2024-02-14 23:34         ` Ira Weiny
2024-02-17  1:17           ` Dan Williams
2024-02-19  9:07             ` Dan Carpenter
2024-02-14 16:40   ` Ira Weiny
2024-02-14 17:11     ` Ira Weiny
2024-02-17 20:07 ` Dan Williams
2024-02-21  4:59   ` Ira Weiny [this message]
2024-02-21 19:57     ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65d5832090c5b_1ada2029473@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox