All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Harald Freudenberger <freude@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	seiden@linux.ibm.com, linux-s390@vger.kernel.org
Subject: Re: [PATCH v1 1/1] s390/uv: Prealloc and use one work page
Date: Mon, 31 Mar 2025 11:35:45 +0200	[thread overview]
Message-ID: <20250331093545.25223B1a-hca@linux.ibm.com> (raw)
In-Reply-To: <f70f6f9c93a8dfb5e0f0f52da882caf7@linux.ibm.com>

On Fri, Mar 28, 2025 at 01:51:06PM +0100, Harald Freudenberger wrote:
> > > +	work_page = (u8 *)__get_free_page(GFP_KERNEL);
> > > +	if (!work_page) {
> > > +		pr_warn("Failed to alloc a working memory page\n");
> > > +		return;
> > > +	}
> > > +
> > >  	uv_stor_base = memblock_alloc_try_nid(
> > 
> > Did you test this? I think this cannot work. When setup_uv() is called
> > the buddy allocator is not yet initialized.
> > Please use memblock_alloc_or_panic() instead.
> > 
> 
> I only compiled this and I wanted to test this today in my
> SEL environment. The patch is a suggestion and should trigger
> maybe some feedback.

Well, you got some feedback :)

> > > -	buf = kzalloc(sizeof(*buf), GFP_KERNEL);
> > > -	if (!buf)
> > > -		return -ENOMEM;
> > > +	mutex_lock(&work_page_lock);
> > > +	buf = (struct uv_secret_list *)work_page;
> > >  	rc = find_secret(secret_id, buf, secret);
> > > -	kfree(buf);
> > > +	mutex_unlock(&work_page_lock);
> > 
> > The commit message does not explain why memory allocation is not
> > acceptable. Usually this translates to non-sleepable context. If that
> > is the case, then using a mutex would be wrong. This needs to be
> > clarified.

But I'm really wondering about this part. Please clarify.

      reply	other threads:[~2025-03-31  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 15:38 [PATCH v1 0/1] Remove the need to alloc memory in uv.c Harald Freudenberger
2025-03-27 15:38 ` [PATCH v1 1/1] s390/uv: Prealloc and use one work page Harald Freudenberger
2025-03-28 10:34   ` Heiko Carstens
2025-03-28 12:51     ` Harald Freudenberger
2025-03-31  9:35       ` Heiko Carstens [this message]

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=20250331093545.25223B1a-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=seiden@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.