Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1591235

Re: [PATCH 2/2] xfs: back off from kmem_zalloc_greedy if the task is killed

From Brian Foster <bfoster@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] xfs: back off from kmem_zalloc_greedy if the task is killed
Date 2017-03-02 17:10 +0100
Message-ID <tgBsJ-4MC-19@gated-at.bofh.it> (permalink)
References <tgAZH-4mT-1@gated-at.bofh.it> <tgB9n-4qi-5@gated-at.bofh.it> <tgB9o-4qi-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 02, 2017 at 04:45:41PM +0100, Michal Hocko wrote:
> From: Michal Hocko <mhocko@suse.com>
> 
> It doesn't really make much sense to retry vmalloc request if the
> current task is killed. We should rather bail out as soon as possible
> and let it RIP as soon as possible. The current implementation of
> vmalloc will fail anyway.
> 
> Suggested-by: Brian Foster <bfoster@redhat.com>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/kmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c
> index ee95f5c6db45..01c52567a4ff 100644
> --- a/fs/xfs/kmem.c
> +++ b/fs/xfs/kmem.c
> @@ -34,7 +34,7 @@ kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize)
>  	size_t		kmsize = maxsize;
>  
>  	while (!(ptr = vzalloc(kmsize))) {
> -		if (kmsize == minsize)
> +		if (kmsize == minsize || fatal_signal_pending(current))
>  			break;
>  		if ((kmsize >>= 1) <= minsize)
>  			kmsize = minsize;
> -- 
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: mm allocation failure and hang when running xfstests generic/269  on xfs Christoph Hellwig <hch@infradead.org> - 2017-03-02 01:40 +0100
  Re: mm allocation failure and hang when running xfstests generic/269  on xfs Xiong Zhou <xzhou@redhat.com> - 2017-03-02 06:40 +0100
    Re: mm allocation failure and hang when running xfstests generic/269  on xfs Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-03-02 07:50 +0100
      Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 09:50 +0100
        Re: mm allocation failure and hang when running xfstests generic/269  on xfs Xiong Zhou <xzhou@redhat.com> - 2017-03-02 10:30 +0100
    Re: mm allocation failure and hang when running xfstests generic/269  on xfs Bob Liu <liubo95@huawei.com> - 2017-03-02 07:50 +0100
    Re: mm allocation failure and hang when running xfstests generic/269on xfs Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-03-02 12:50 +0100
    Re: mm allocation failure and hang when running xfstests generic/269  on xfs Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-03-02 13:00 +0100
      Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 13:30 +0100
        Re: mm allocation failure and hang when running xfstests generic/269  on xfs Brian Foster <bfoster@redhat.com> - 2017-03-02 13:30 +0100
          Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 14:10 +0100
            Re: mm allocation failure and hang when running xfstests generic/269  on xfs Brian Foster <bfoster@redhat.com> - 2017-03-02 15:00 +0100
              Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 15:00 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Brian Foster <bfoster@redhat.com> - 2017-03-02 16:00 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Brian Foster <bfoster@redhat.com> - 2017-03-02 16:40 +0100
                [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Michal Hocko <mhocko@kernel.org> - 2017-03-02 16:50 +0100
                [PATCH 2/2] xfs: back off from kmem_zalloc_greedy if the task is killed Michal Hocko <mhocko@kernel.org> - 2017-03-02 16:50 +0100
                Re: [PATCH 2/2] xfs: back off from kmem_zalloc_greedy if the task         is killed Christoph Hellwig <hch@lst.de> - 2017-03-02 17:00 +0100
                Re: [PATCH 2/2] xfs: back off from kmem_zalloc_greedy if the task is  killed Brian Foster <bfoster@redhat.com> - 2017-03-02 17:10 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Brian Foster <bfoster@redhat.com> - 2017-03-02 17:10 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Christoph Hellwig <hch@lst.de> - 2017-03-02 17:20 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Michal Hocko <mhocko@kernel.org> - 2017-03-02 17:40 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-03-02 17:50 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Dave Chinner <david@fromorbit.com> - 2017-03-04 00:00 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-03-04 00:30 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Dave Chinner <david@fromorbit.com> - 2017-03-04 05:50 +0100
                Re: [PATCH 1/2] xfs: allow kmem_zalloc_greedy to fail Michal Hocko <mhocko@kernel.org> - 2017-03-06 14:30 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 20:20 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Christoph Hellwig <hch@infradead.org> - 2017-03-02 19:00 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 20:20 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Brian Foster <bfoster@redhat.com> - 2017-03-02 16:00 +0100
                Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 18:40 +0100
              Re: mm allocation failure and hang when running xfstests generic/269  on xfs Brian Foster <bfoster@redhat.com> - 2017-03-02 15:00 +0100
              Re: mm allocation failure and hang when running xfstests generic/269  on xfs Michal Hocko <mhocko@kernel.org> - 2017-03-02 15:10 +0100
              Re: mm allocation failure and hang when running xfstests generic/269 on xfs Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-03-02 17:00 +0100

csiph-web