mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: linux-kernel@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH 1/3] frv: remove irqsave pgd_lock locking
Date: Thu, 1 Dec 2011 15:19:41 +0100	[thread overview]
Message-ID: <20111201141941.GA4490@tiehlicka.suse.cz> (raw)
In-Reply-To: <1320853639-18048-1-git-send-email-mhocko@suse.cz>

Ping

On Wed 09-11-11 16:47:17, Michal Hocko wrote:
> a79e53d8: x86/mm: Fix pgd_lock deadlock dropped irqsave locking to fix a
> deadlock. pgd_lock is not used from an irq context so we can drop
> irqsave locking here as well.
> The original patch was x86 only but the same applies here because both
> pgd_ctor (aka mm_alloc_pgd) and pgd_dtor (aka mm_free_pgd) are not used
> from an interrupt contexts.
> 
> Signed-off-by: Michal Hocko <mhocko@suse.cz>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> ---
>  arch/frv/mm/pgalloc.c |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c
> index 4fb63a3..9df65c6 100644
> --- a/arch/frv/mm/pgalloc.c
> +++ b/arch/frv/mm/pgalloc.c
> @@ -104,10 +104,8 @@ static inline void pgd_list_del(pgd_t *pgd)
>  
>  void pgd_ctor(void *pgd)
>  {
> -	unsigned long flags;
> -
>  	if (PTRS_PER_PMD == 1)
> -		spin_lock_irqsave(&pgd_lock, flags);
> +		spin_lock(&pgd_lock);
>  
>  	memcpy((pgd_t *) pgd + USER_PGDS_IN_LAST_PML4,
>  	       swapper_pg_dir + USER_PGDS_IN_LAST_PML4,
> @@ -117,18 +115,16 @@ void pgd_ctor(void *pgd)
>  		return;
>  
>  	pgd_list_add(pgd);
> -	spin_unlock_irqrestore(&pgd_lock, flags);
> +	spin_unlock(&pgd_lock);
>  	memset(pgd, 0, USER_PGDS_IN_LAST_PML4 * sizeof(pgd_t));
>  }
>  
>  /* never called when PTRS_PER_PMD > 1 */
>  void pgd_dtor(void *pgd)
>  {
> -	unsigned long flags; /* can be called from interrupt context */
> -
> -	spin_lock_irqsave(&pgd_lock, flags);
> +	spin_lock(&pgd_lock);
>  	pgd_list_del(pgd);
> -	spin_unlock_irqrestore(&pgd_lock, flags);
> +	spin_unlock(&pgd_lock);
>  }
>  
>  pgd_t *pgd_alloc(struct mm_struct *mm)
> -- 
> 1.7.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

      parent reply	other threads:[~2011-12-01 14:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 15:47 Michal Hocko
2011-11-09 15:47 ` [PATCH 2/3] tile: " Michal Hocko
2011-11-10 18:50   ` Chris Metcalf
2011-11-11  8:15     ` Michal Hocko
2011-11-09 15:47 ` [PATCH 3/3] mn10300: " Michal Hocko
2011-12-01 14:19   ` Michal Hocko
2011-12-01 14:19 ` Michal Hocko [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=20111201141941.GA4490@tiehlicka.suse.cz \
    --to=mhocko@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®