From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() Date: Tue, 01 Dec 2015 12:02:26 -0500 Message-ID: References: <1448404418-28800-1-git-send-email-toshi.kani@hpe.com> <1448404418-28800-2-git-send-email-toshi.kani@hpe.com> <20151201135000.GB4341@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbbLARC3 (ORCPT ); Tue, 1 Dec 2015 12:02:29 -0500 In-Reply-To: (Dan Williams's message of "Tue, 1 Dec 2015 08:54:23 -0800") Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Dan Williams Cc: Borislav Petkov , Tony Luck , Linux ACPI , "linux-nvdimm@lists.01.org" , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Linux MM , Andrew Morton Dan Williams writes: >>> @@ -57,7 +57,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size) >>> */ >>> void *memremap(resource_size_t offset, size_t size, unsigned long flags) >>> { >>> - int is_ram = region_intersects(offset, size, "System RAM"); >> >> Ok, question: why do those resource things types gets identified with >> a string?! We have here "System RAM" and next patch adds "Persistent >> Memory". >> >> And "persistent memory" or "System RaM" won't work and this is just >> silly. >> >> Couldn't struct resource have gained some typedef flags instead which we >> can much easily test? Using the strings looks really yucky. >> > > At least in the case of region_intersects() I was just following > existing strcmp() convention from walk_system_ram_range. ...which is done in the page fault path. I agree with the suggestion to get strcmp out of that path. -Jeff From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by kanga.kvack.org (Postfix) with ESMTP id 633D26B0253 for ; Tue, 1 Dec 2015 12:02:30 -0500 (EST) Received: by qkda6 with SMTP id a6so5069932qkd.3 for ; Tue, 01 Dec 2015 09:02:30 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id y19si50870168qhb.115.2015.12.01.09.02.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 09:02:29 -0800 (PST) From: Jeff Moyer Subject: Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() References: <1448404418-28800-1-git-send-email-toshi.kani@hpe.com> <1448404418-28800-2-git-send-email-toshi.kani@hpe.com> <20151201135000.GB4341@pd.tnic> Date: Tue, 01 Dec 2015 12:02:26 -0500 In-Reply-To: (Dan Williams's message of "Tue, 1 Dec 2015 08:54:23 -0800") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Dan Williams Cc: Borislav Petkov , Tony Luck , Linux ACPI , "linux-nvdimm@lists.01.org" , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Linux MM , Andrew Morton Dan Williams writes: >>> @@ -57,7 +57,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size) >>> */ >>> void *memremap(resource_size_t offset, size_t size, unsigned long flags) >>> { >>> - int is_ram = region_intersects(offset, size, "System RAM"); >> >> Ok, question: why do those resource things types gets identified with >> a string?! We have here "System RAM" and next patch adds "Persistent >> Memory". >> >> And "persistent memory" or "System RaM" won't work and this is just >> silly. >> >> Couldn't struct resource have gained some typedef flags instead which we >> can much easily test? Using the strings looks really yucky. >> > > At least in the case of region_intersects() I was just following > existing strcmp() convention from walk_system_ram_range. ...which is done in the page fault path. I agree with the suggestion to get strcmp out of that path. -Jeff -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756147AbbLARCa (ORCPT ); Tue, 1 Dec 2015 12:02:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbbLARC3 (ORCPT ); Tue, 1 Dec 2015 12:02:29 -0500 From: Jeff Moyer To: Dan Williams Cc: Borislav Petkov , Tony Luck , Linux ACPI , "linux-nvdimm\@lists.01.org" , "Rafael J. Wysocki" , "linux-kernel\@vger.kernel.org" , Linux MM , Andrew Morton Subject: Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() References: <1448404418-28800-1-git-send-email-toshi.kani@hpe.com> <1448404418-28800-2-git-send-email-toshi.kani@hpe.com> <20151201135000.GB4341@pd.tnic> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Tue, 01 Dec 2015 12:02:26 -0500 In-Reply-To: (Dan Williams's message of "Tue, 1 Dec 2015 08:54:23 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: >>> @@ -57,7 +57,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size) >>> */ >>> void *memremap(resource_size_t offset, size_t size, unsigned long flags) >>> { >>> - int is_ram = region_intersects(offset, size, "System RAM"); >> >> Ok, question: why do those resource things types gets identified with >> a string?! We have here "System RAM" and next patch adds "Persistent >> Memory". >> >> And "persistent memory" or "System RaM" won't work and this is just >> silly. >> >> Couldn't struct resource have gained some typedef flags instead which we >> can much easily test? Using the strings looks really yucky. >> > > At least in the case of region_intersects() I was just following > existing strcmp() convention from walk_system_ram_range. ...which is done in the page fault path. I agree with the suggestion to get strcmp out of that path. -Jeff