Received: by 10.223.176.46 with SMTP id f43csp2903250wra; Mon, 22 Jan 2018 05:26:44 -0800 (PST) X-Google-Smtp-Source: AH8x226e/6JY7GmE0YJr7ET2tGs7rCp6Nb1nqQlTeLUaM6I9ZmzBHUs5fy4RzGJFY6NAziT/fFEp X-Received: by 10.101.97.165 with SMTP id i5mr7209784pgv.55.1516627603964; Mon, 22 Jan 2018 05:26:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516627603; cv=none; d=google.com; s=arc-20160816; b=Gu5i1Dx//a+wPyS3DfYI6b+OZxa1Rs+AUsfSqGpL4iHn0hwDglFG4uruxrEN6i7mRK DAN6KvwA4yR5ULSnKb4/iA/3L/eyDPN8kJKdcb6j55cavXAXa2ac/hlfkdiTO3515uP9 tZ+glCkC8FPpFITH688DsICg8n5kI8veF56kV/0V10z2TQxDqqCmF4Djt21OCPJijeWV Wy/VnOSZEl/Wj2F4x/SiWu4RSIw1Bx98gZmBDt1U6+sxg2YQKN+AH4A5hggiE/Q7ei0J NlyxRdFLh/rKkEbbfVBrSOlPhGHMifdJ4WYp4FOdE/B06Ku/dwvpc4hJ0xDNM9Ux6rcS 8N8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:dkim-signature :arc-authentication-results; bh=d+zKT16e8GJu5E+FcilsMHX69vSrYYtgLE86CqHZs/g=; b=AjVxeh3RJcnegzefEou3UWK1CW50i9oN/TVh2h/mzX18fvwpkvvQyxCQsLeWvqmB32 Z2YXhsPu/FIWPwPuZp+7gNljz/ZfU6jGYpIrgxRC3pWjH0qk3EZ1ayPQlYPXOdZTr4qb BpgO940d68yomlVzb6BI43YLoFK2TFHyRFUlFk3D4j0amIlCiLAfPhjeWN69zArZHisu 0NdkVzjRqhZUqB0l8G9eu4ScY4SXO4QkEbcEFTteGuCmX8h9CkvqKTi23xfmsgfMhQT8 XdUFsqK2yz/EVDMwmdL5r1z1ycbOk2Ji9NUi7xruB6uNhDmDcgiPe7SinEXlhWAQ3vo8 Gy1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@prevas.dk header.s=ironport2 header.b=CUxbztoK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si167095pfa.273.2018.01.22.05.26.29; Mon, 22 Jan 2018 05:26:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@prevas.dk header.s=ironport2 header.b=CUxbztoK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751116AbeAVN0G (ORCPT + 99 others); Mon, 22 Jan 2018 08:26:06 -0500 Received: from mail02.prevas.se ([62.95.78.10]:10906 "EHLO mail02.prevas.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbeAVN0F (ORCPT ); Mon, 22 Jan 2018 08:26:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=742; q=dns/txt; s=ironport2; t=1516627565; x=1548163565; h=from:subject:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=Ly5gRuVhJruY+vX9DGVe8X0J6L5t8DiVZalkZBBxsTE=; b=CUxbztoKkKyFevU+HD1TxLcXL9zu+mestFX8TMwS7xvK5q5HLyeMscPy avv7CXciD1J46Cbt/dwgcNJ1QXUqsZqrHeI3qVjJ1BFbKPMYZDytOi246 6uCFt5mer6oCRXYaIz/wCgDw5Lj93PEVKUZex/0gp/nb2pzRFPEWcy1Zr c=; X-IronPort-AV: E=Sophos;i="5.46,396,1511823600"; d="scan'208";a="2946614" Received: from vmprevas4.prevas.se (HELO smtp.prevas.se) ([172.16.8.104]) by ironport2.prevas.se with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 14:26:03 +0100 Received: from [172.16.11.49] (172.16.8.31) by smtp.prevas.se (172.16.8.104) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 22 Jan 2018 14:26:02 +0100 From: Rasmus Villemoes Subject: Re: [mm 4.15-rc8] Random oopses under memory pressure. To: Linus Torvalds CC: "Kirill A. Shutemov" , Matthew Wilcox , Al Viro , Linux Kernel Mailing List References: <201801170233.JDG21842.OFOJMQSHtOFFLV@I-love.SAKURA.ne.jp> <201801172008.CHH39543.FFtMHOOVSQJLFO@I-love.SAKURA.ne.jp> <201801181712.BFD13039.LtHOSVMFJQFOFO@I-love.SAKURA.ne.jp> <20180118122550.2lhsjx7hg5drcjo4@node.shutemov.name> <20180118145830.GA6406@redhat.com> <20180118165629.kpdkezarsf4qymnw@node.shutemov.name> <20180118234955.nlo55rw2qsfnavfm@node.shutemov.name> <20180119125503.GA2897@bombadil.infradead.org> Message-ID: <6f0abb8d-84b3-070e-fca7-c71524311702@prevas.dk> Date: Mon, 22 Jan 2018 14:26:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.8.31] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-01-19 19:42, Linus Torvalds wrote: > > I actually asked (long long ago) for an optinal compiler warning for > "pointer subtraction with non-power-of-2 sizes". Not because of it > being undefined, but simply because it's expensive. The > divide->multiply thing doesn't always work, Huh? If (compile-time constant, positive) d=m*2^k with m odd, and x is known to be a multiple of d, x/d can always be computed as (x>>k)*m' == (x*m')>>k, with m' being the mod 2^N multiplicative inverse of m, right? This works whether x has signed or unsigned type and whether it indeed happens to be negative, AFAICT. Sure, the multiplication by m' may not exactly be cheap, but one only needs the low N bits of the result. Rasmus