From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Hellstrom Subject: Re: [PATCH] drm/ttm: handle OOM in ttm_tt_swapout Date: Tue, 23 Feb 2010 14:26:39 +0100 Message-ID: <4B83D78F.8050106@vmware.com> References: <1266632541-2740-1-git-send-email-madman2003@gmail.com> <21d7e9971002222159q593abd37ke6d713846de08ca6@mail.gmail.com> <6d4bc9fc1002230039s6f0a83c9ve5f1313f2ed9db6f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <6d4bc9fc1002230039s6f0a83c9ve5f1313f2ed9db6f@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: Maarten Maathuis Cc: "dri-devel@lists.sf.net" List-Id: dri-devel@lists.freedesktop.org Maarten Maathuis wrote: > On Tue, Feb 23, 2010 at 6:59 AM, Dave Airlie wrote: > >> On Sat, Feb 20, 2010 at 12:22 PM, Maarten Maathuis wrote: >> >>> - Without this change I get a general protection fault. >>> - Also use PTR_ERR where applicable. >>> >> I just want to make sure I understand, but really the only bit of this >> patch that matters is: >> >> >>> @@ -556,9 +559,10 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) >>> if (unlikely(from_page == NULL)) >>> continue; >>> to_page = read_mapping_page(swap_space, i, NULL); >>> - if (unlikely(to_page == NULL)) >>> + if (unlikely(IS_ERR(to_page))) { >>> >> ^^ these two lines where we are testing for NULL but should be >> checking for an error? >> > > Yes, that's the critical bit. As you can see we were already doing > this for ttm_tt_swapin. > > >>> + ret = PTR_ERR(to_page); >>> goto out_err; >>> - >>> + } >>> >> If that is true and the rest is just nice cleanups then I'm okay with it,. >> >> Reviewed-by: Dave Airlie >> >> I'll need Thomas's ack on this also. >> >> Dave. >> Acked-by: Thomas Hellstrom /Thomas ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --