From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 039DBC433DF for ; Wed, 14 Oct 2020 15:11:14 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBEAA22201 for ; Wed, 14 Oct 2020 15:11:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FUjfjJk4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBEAA22201 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1kSiQM-0003HD-RA; Wed, 14 Oct 2020 11:10:42 -0400 Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kSiQJ-0003H8-K8 for kernelnewbies@kernelnewbies.org; Wed, 14 Oct 2020 11:10:39 -0400 Received: by mail-vs1-xe34.google.com with SMTP id u74so2291002vsc.2 for ; Wed, 14 Oct 2020 08:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fwPpHo5Eyh0COSSYytA3AGUPTxVeoN9ziqQdD/Z9nuU=; b=FUjfjJk4VisqVYoqLUZxiAas0WqL19qnc8lXo/k5LdVuTXMTu+kLy9/Ts3zub9VQGc /g1t8DVXczKX6ISZ7tXlqd2562NtdoZgWZDPDpkX+DxZm6U63IF6MVGh4HZ0VpNSTKU5 AfM37YiSBH+9rJV3JfaiC86TRRGrJAGEXkw7bIq2G+urcUD+zhSEavQCSlzZXEfXZsfn aYWxt/Qz04oCbdIxu6zT76TwRsF5+ZF9zcyHyuW8RO2ue1eyqSpm6yRgyc2BnoQRN4Mk KWtqW2UThJIN4WKaFwr9g2/WVBZ1kFPYa0Pn78Rq/fkwS+Jl+uIFhQ4LgVZqjE4NjmA5 icew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fwPpHo5Eyh0COSSYytA3AGUPTxVeoN9ziqQdD/Z9nuU=; b=FSSg0vc3crgNGtvbOR5YFBqRg4TxZm0gtqKaQAhx+KkYEFE4S/reHtvzPmocsA0VRb 6d6qHBJqNTOeO9AlLbqCogUsDZSyb6pVTrdajzOCOWYgHHMlF4YEsOIeUoMH/tA9Ar5Q Yvfuat7pd56sbzlSh35RS1vpT2xqmJO5x4KxQBZ+y0RBVWwVjs/NZza69e+LQqsZNom+ FUmgU3Ea7M1nqXjRKOw0nWGKw05JoUZ+ehqEzjYlLrAZfCk0lCmc/fl0sgcY0jVDjX7y 9TmQSUCn9/EzAZwX2ZHxrb4uyk1zbPwh7vVPHPqPw8ULA5NiMXgkOuVPDl38cE0FCDjR 8E7Q== X-Gm-Message-State: AOAM532zdLqoOhV0GrU8DdypJu0styF/faSjuEt2nApzvYhZtIG2md7B 93P2VIoqAz6J/XuNRsd8CtDRuPeoLMKrILagWmBhnKAeuj8= X-Google-Smtp-Source: ABdhPJw/6UEK/n5bFU5bUdopkMT+tYAcDW5vCTgo2ahp2LvUgujo/qRE1ATRAZzFY0LvapNKXoOcBKx/qb3jW5kak/Y= X-Received: by 2002:a67:d297:: with SMTP id z23mr91308vsi.14.1602688177937; Wed, 14 Oct 2020 08:09:37 -0700 (PDT) MIME-Version: 1.0 From: jim.cromie@gmail.com Date: Wed, 14 Oct 2020 09:09:11 -0600 Message-ID: Subject: opaque "pointer" API, model, best practice ? To: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org hi all, is there an api / usage model / or best practice for opaque "handles" ? Im aware of 1 case: the handle returned by zs_malloc I have tried to use it, and have run into locking conflicts when trying to keep the memory zs_mapped longer than the duration of a function. OTOH, if I map and unmap within the function, things work, but this is unacceptable overhead. so I figure I should read some good code, rather than keep hacking at bad code. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies