Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6341834imu; Tue, 13 Nov 2018 23:11:58 -0800 (PST) X-Google-Smtp-Source: AJdET5eWNbTeFgget7zo6aK6KUXKOt9N1KMG1j3WPwy7QTZngwDLIZSa6jxn9jlfr9Z9nUuNsUXK X-Received: by 2002:a62:8742:: with SMTP id i63-v6mr794591pfe.41.1542179518507; Tue, 13 Nov 2018 23:11:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542179518; cv=none; d=google.com; s=arc-20160816; b=h1EzcWS58j39KvrOQj1SOZz7hPcpaTBSvmIruUjHGZaXI+1nd/noWUT7NQarf6dVEM JtDvcwtiZ5edD64endpJh1WW/9n0N9/J/TRA47qS7ANZWvx1XIZdMxmIqTGv0UyUwCD3 lWwUiOps2wFXu/jI1D28+cGwveoZVV6R+z/xtVa02mVTI0VwgprvynvnOOulFhXgj8Gy aKYRJ4qArzJfOw5s/XBrYQOxU01wkKZ6NcCsEEIMDdH1xon5tXLj462Ue0TkehDhXHip hR/xuv0djwcLxWFnx6Y3Z9y7n0Bi78tjMYh24eih6wuysgikgEuhXctXv/+GLztKq5rm vFiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4+8CtKLUsr6zVBs190ICSN7dLqurWT3w5gPIUO0URzA=; b=sPdMY94IgVGwv8LbBDcDFe7kSKOnRaXsUwUVN7Hj+mvTUB1IqIJ+MFHAbBSmlNWVCS ColQkMJgcmw0Gk5ko+KwJ+6xc0KCjARb3i811rSivCuKuqEA+k2ICb8jMqyEO16NKegd w7sP28bSGPUD7lqph7t9Uucg7tqIQbUKd/UrIspCx92VILRI/oE2aayH0nMO3W6tM2OG nizH8UwVCbaP8g0kiuRR8fUJcYDQ1FB8K/RiSjbXQF1YMLsBnv91/Ahfqqbvk+A9yhYz crsEmIwaPmXEryzXMzMwr6iT2OzzeA6Gl9Ld7a5jEVg+HuRtomQYa+082FpumqM5GJuq Hcig== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13-v6si23214929pgf.435.2018.11.13.23.11.43; Tue, 13 Nov 2018 23:11:58 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731105AbeKNRMx (ORCPT + 99 others); Wed, 14 Nov 2018 12:12:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:43936 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726927AbeKNRMx (ORCPT ); Wed, 14 Nov 2018 12:12:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5393AB08D; Wed, 14 Nov 2018 07:10:54 +0000 (UTC) Date: Wed, 14 Nov 2018 08:10:52 +0100 From: Michal Hocko To: Andrew Morton Cc: Kyungtae Kim , pavel.tatashin@microsoft.com, vbabka@suse.cz, osalvador@suse.de, rppt@linux.vnet.ibm.com, aaron.lu@intel.com, iamjoonsoo.kim@lge.com, alexander.h.duyck@linux.intel.com, mgorman@techsingularity.net, lifeasageek@gmail.com, threeearcat@gmail.com, syzkaller@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Konstantin Khlebnikov Subject: Re: UBSAN: Undefined behaviour in mm/page_alloc.c Message-ID: <20181114071052.GA23419@dhcp22.suse.cz> References: <20181109084353.GA5321@dhcp22.suse.cz> <20181113094305.GM15120@dhcp22.suse.cz> <20181113152941.cc328e48d5c0c2f366f5db83@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113152941.cc328e48d5c0c2f366f5db83@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 13-11-18 15:29:41, Andrew Morton wrote: [...] > But do we really need to do this? Are there any other known potential > callsites? The main point is that the code as it stands is quite fragile, isn't it? Fixing up all the callers is possible but can you actually think of a reason why this would cause any measurable effect in the fast path? The order argument is usually in a register and comparing it to a number with unlikely branch should be hardly something visible. Besides that we are talking few cycles at best compared to a fragile code that got broken by accident without anybody noticing for quite some time. I vote for the maintainability over few cycles here. Should anybody find this measurable we can rework the code by other means. -- Michal Hocko SUSE Labs