Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753981AbdIFMjl convert rfc822-to-8bit (ORCPT ); Wed, 6 Sep 2017 08:39:41 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:56073 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753550AbdIFMjj (ORCPT ); Wed, 6 Sep 2017 08:39:39 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Tvrtko Ursulin , "Tvrtko Ursulin" , Intel-gfx@lists.freedesktop.org From: Chris Wilson In-Reply-To: <005d683d-9f72-cb01-152f-4ccef0bbfd8b@linux.intel.com> Cc: linux-kernel@vger.kernel.org References: <20170731185512.20010-5-tvrtko.ursulin@linux.intel.com> <20170905102403.18463-1-tvrtko.ursulin@linux.intel.com> <150469489418.28581.10979037821117823587@mail.alporthouse.com> <005d683d-9f72-cb01-152f-4ccef0bbfd8b@linux.intel.com> Message-ID: <150470157212.5486.15223573670024117741@mail.alporthouse.com> User-Agent: alot/0.3.6 Subject: Re: [Intel-gfx] [PATCH v2 5/5] tools/testing/scatterlist: Test new __sg_alloc_table_from_pages Date: Wed, 06 Sep 2017 13:39:32 +0100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1065 Lines: 26 Quoting Tvrtko Ursulin (2017-09-06 13:10:57) > > On 06/09/2017 11:48, Chris Wilson wrote: > > All ascending. Interesting challenge for 3,2,1,0; it can be coalesced, > > we just don't. I wonder if we are missing some like that. But for the > > Hm, how do you think descending pages could be coalesced? By > re-arranging the pages? But that would break everything, do I don't get it. Wishful thinking; I wasn't considering the order inside the object, just their physical addresses. > > > moment, 0, 2, 1, would be a good addition to the above set. > > > > Is there any value in checking overflows in this interface? > > Overflows as in size > num_pages * PAGE_SIZE as passed in to > __sg_alloc_table_from_pages ? It is not checked in the implementation at > the moment and it looks it is harmless. Just thinking aloud if there was a way to get a mult/add overflow. That we do page size coalescing, the only avenue is from a buggy max_seg. Going back to the makefile, perhaps add the magic for ubsan as well? -fsanitize=address -fsanitize=undefined -Chris